How to Install Arch Linux - 2021
Published on: August 3, 2021
Commands
1. Set the Keyboard Layout
$ loadkeys yourKeyboardLayout
The default console keymap is US. Available layouts can be listed with:
$ ls /usr/share/kbd/keymaps/**/*.map.gz
2. Config the Best Mirrors
$ reflector -c "BR" -f 12 -n 10 -l 12 \
--save /etc/pacman.d/mirrorlist --verbose
$ pacman -Syy
3. Partitioning the Disk
$ fdisk /dev/yourDevice
Create the root partition and the swap.
4. Formatting the partitions
use mkfs.ext4, mkswap and mkfs.fat.
5. Mounting
use mount and swapon.
6. Install the Base
$ pacstrap /mnt base base-devel linux \
linux-firmware vim sudo networkmanager \
efibootmgr grub
7. Generate fstab
$ genfstab -U /mnt >> /mnt/etc/fstab
8. Enter the install
$ arch-chroot /mnt
9. Timezone
$ ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
10. Localization
Edit /etc/locale.gen and uncomment your locale. After, generate the locales by running:
$ locale-gen
Create the /etc/locale.conf and set the LANG variable
LANG=en_US.UTF-8
Create /etc/vconsole.conf with your keyboard layout:
KEYMAP=de-latin
11. Network configuration
Create /etc/hostname with the name your host
nameFromYourHost
Create /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.0.1 nameFromYourHost.localdomain nameFromYourHost
$ systemctl enable NetworkManager
12. Set the root password
$ passwd
13. Install the Bootloader
$ grub-install --target=x86_64-efi \
--efi-directory=/boot/efi \
--bootloader-id=GRUB
$ grub-mkconfig -o \
/boot/grub/grub.cfg
14. Umount and Reboot
$ exit
$ umount -a
$ reboot
15. Create a new user
$ useradd -m -G wheel yourUsername
$ passwd yourUsername