Since I live in germany, I set my time zone and keyboard layout to it. This does not apply to the system language!
I am writing this guide while installing Arch in a virtual machine.
Therefore my hard disk is /dev/sda and the hostname arch-vm.
- Change the keyboard layout temporarily:
loadkeys de-latin1 - Update the system clock:
timedatectl set-ntp true - Check where your disk lives:
fdisk -l- For IDE controllers:
/dev/hda,/dev/hdb,/dev/hdc - For SATA controllers:
/dev/sda,/dev/sdb,/dev/sdc - For NVMe controllers:
/dev/nvme0,/dev/nvme1
- For IDE controllers:
- Create new partitions on your target drive:
fdisk /dev/sda- enter
gto create a new GPT partition table - enter
nfor a new partition and set the last vector to:+512M-> efi - enter
nfor a new partition and set the last vector to :+8192M-> swap - enter
nfor a new partition and leave everything blank (default) -> root
- enter
- Change the partition types
- enter
tfollowed by1to select theefipartition and enter1to set theEFI Systemtype - enter
tfollowed by2to select theswappartition and enter19to set theLinux swaptype - enter
tfollowed by3to select therootpartition and enter24to set theLinux root (x86-64)type
- enter
- Enter
wto write the partitions and exitfdisk - Format the EFI partition as fat32:
mkfs.vfat -n EFIBOOT /dev/sda1 - Format the Linux swap:
mkswap -L swap /dev/sda2 - Format the root filesystem as ext4:
mkfs.ext4 -L arch /dev/sda3 - Enable the Linux swap:
spwaon /dev/sda2 - Mount the root partition on
/mnt:mount /dev/sda3 /mnt - Create the boot mount point:
mkdir -p /mnt/boot - Mount the boot partition:
mount /dev/sda1 /mnt/boot - Install base packages:
pacstrap /mnt base-devel linux linux-firmware nano vim intel-ucode - Generate a new fstab file:
genfstab -U /mnt >>/mnt/etc/fstab- Optional verify the generated fstab:
cat /mnt/etc/fstab
- Optional verify the generated fstab:
- Enter chroot environment:
arch-chroot /mnt - Update the timezone:
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime - Generate the
/etc/adjtimefile:hwclock --systohc - Uncomment needed locales in
/etc/locale.genand generate locales:locale-gen && echo 'LANG=en_US.UTF-8' > /etc/locale.conf - Change the default keyboard layout:
echo 'KEYMAP=de-latin1' > /etc/vconsole.conf - Set the hostname (required for the next step):
echo 'arch-vm' > /etc/hostname - Add the following code into
/etc/hostsand changearch-vminto your hostname
127.0.0.1 localhost
::1 localhost
127.0.1.1 arch-vm.localdomain arch-vm
- Install necessary packages:
pacman -S grub efibootmgr linux-headers linux-lts linux-lts-headers networkmanager - Enable the network manager, otherwise your internet connection won't work:
systemctl enable NetworkManager - Update the root password:
passwd - Create the directory efi directory for the bootloader:
mkdir -p /boot/efi - Mount the efi partition:
mount /dev/sda1 /boot/efi - Install grub:
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi --recheck - Generate the configuration for grub:
grub-mkconfig -o /boot/grub/grub.cfg - Exit chroot environment:
exit - Unmount everything and reboot:
unmount -a && reboot
tba