Skip to content

Arch linux Instalation Guide

Arthur Temporim edited this page Jul 15, 2024 · 11 revisions

Arch Linux

In this file, I will describe how to install Arch Linux step by step and how to solve some troubleshooting.

Installation guides:

Here are some useful instalation guides:

Pre installation

Download

Download the Arch linux here

USB

Here is the explanation to use dd command to create a startup disk creator.

Here is the command it self:

dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync

EFI

I mainly chose to use UEFI, so here is the reference to it:

Instalation

Here I saved all commands used while installing:

  • Change the keyboard to Brazil type.

loadkeys br-abnt2

  • Disable beep:

ˋrmmod pcspkrˋ

  • fdisk can manage partitions.

fdisk -l

  • Chose a partition:

fdisk /dev/sda

  • After you choose the desired HD you will install your Arch use these commands to manage your partitions:

    • m: List the fdisk options

    • d: Delete old partitions

    • n: Create new partitions (pass the wanted partition sizes)

    • t: Add a table to the partitions

    • w: Write all changes

  • Example:

# Delete existing partitions
d <enter>

# Create new partitions
n <enter> +512M
n <enter> +16G
n <enter> <enter>
# Write everything
w
  • After all partitions were created, format it with mkfs
mkfs.vfat /dev/nvme0n1p1

mkswap /dev/nvme0n1p2

mkfs.ext4 /dev/nvme0n1p3
  • Mount partitions in the specific folders.

mount /dev/nvme0n1p3 /mnt

mkdir -p /mnt/boot/efi && mount /dev/nvme0n1p1 /mnt/boot/efi

  • Update Keyring

pacman -Sy archlinux-keyring

  • Install the base system

pacstrap /mnt base base-devel linux linux-firmware sudo man-db vim

  • Generate the fstab file.

genfstab -p /mnt >> /mnt/etc/fstab

arch-chroot /mnt

  • Enable package parallel download

Edit /etc/pacman.conf

Find and uncomment the line:

ParallelDownloads = 10

  • Now you can install some packages to use in the installation they will remain in the system.

pacman -S vim git links make tree htop go sudo networkmanager grub efibootmgr bash-completion

  • Set root password.

passwd

  • Install Network:
systemctl enable NetworkManager.service
  • Create User:
visudo

Change these lines:

## Uncomment to allow members of group wheel to execute any command
# %wheel ALL=(ALL) ALL
%wheel ALL=(ALL) ALL
useradd -m -g users -G wheel arthur
passwd arthur

vim /etc/timezone # Insert: America/Sao_Paulo

ln -sf /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime

  • Set the "computer" name.

vim /etc/hostname # Insert: tempoarch

mkinitcpio -P

  • Configure your bootloader, I use GRUB.

grub-install /dev/nvme0n1p1

grub-mkconfig -o /boot/grub/grub.cfg

yay

  • Reference

  • execute os comandos abaixo como usário comum (não root):

su arthur

cd /home/arthur

git clone https://aur.archlinux.org/yay.git

cd yay

makepkg -si

  • If dual boot with windows or other systems is need to install os-prober
yay -S os-prober update-grub
# Edit the file /etc/default/grub and uncomment the line with the env var:
GRUB_DISABLE_OS_PROBER=false
vim /etc/default/grub
update-grub

Now windows will be listed when start up.

Optional installation

Nvidia
  • According to nvidia installation, my actual graphic card is a Geforce 940MX: For the Maxwell (NV110) series and newer, including GeForce 930~, 10-20, Quadro/Tesla/Tegra cards and newer (for a detailed list, see Official Readme), install the nvidia package

So the installation is:

pacman -S nvidia

With the commands above, you already have an Arch Linux Operational System, Everything below is optional.

  • Install the display server Xorg.

pacman -S xorg-server xorg-xinit

pacman -S alsa-utils

sudo pacman -S gnome

  • Enable GDM

sudo systemctl enable gdm.service

  • Download my bash settings:
wget -O - https://raw.githubusercontent.com/arthurTemporim/my-env/main/bash/bashrc > ~/.bashrc
wget -O - https://raw.githubusercontent.com/arthurTemporim/my-env/main/bash/bash_aliases > ~/.bash_aliases

source ~/.bashrc
  • Python

pip:

yay -S python-pip
pip install --upgrade pip

env:

pip install virtualenv

pyenv:

yay -S pyenv
yay -S pyenv-virtualenv

virtualenvwrapper:

yay -S python-virtualenvwrapper

pyenv + virtualenvwrapper:

yay -S pyenv-virtualenvwrapper
source .bashrc
pyenv virtualenvwrapper
  • Util programs
# General programs
yay -S htop tree wget terminator google-chrome firefox spotify
# Bluetooth
yay -S bluez-utils
sudo systemctl enable  bluetooth.service
# Docker
yay -S docker docker-compose
sudo usermod -aG docker $USER

Ok, now you have a good base to use Arch Linux :D.

Troubleshooting

This section is the solution to some troubles I had.

  • Gnome system monitor applet
#Clone the repository
git clone https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet.git
cd gnome-shell-system-monitor-applet
make install
# Edit the file
vim ~/.local/share/gnome-shell/extensions/[email protected]/metadata.json
# Add "version": "42" to the end of the file (inside the json brackets)
# Log out and it's done

Reference to solve this issue.

  • Terminal doesn't understand 'ç' like chars, the solution was to add export LC_ALL=pt_BR.UTF-8 in the .bashrc. If needed you can update the following env vars:
export LC_ALL=pt_BR.UTF-8
export LANG=pt_BR.UTF-8
export LANGUAGE=pt_BR.UTF-8

Reference

  • When you need to use things like network, or docker, you need to add then to systemd configuration, like:
systemctl enable NetworkManager.service
systemctl start NetworkManager.service

So you can run:

systemctl list-unit-files

And see what you will enable and start.

yay -S bash-completion
source /usr/share/git/completion/git-completion.bash
  • Remove beep

echo "blacklist pcspkr" > /etc/modprobe.d/nobeep.conf

  • Update time (this happened when I use windows and back to arch in dual boot)

sudo ntpd -qg