So you want to install Arch Linux but got lost in the Wiki. This is a quick guide for installing a basic system. It is far from being feature-complete, as it makes some basic assumptions.
- You want to use the entire disk for Arch Linux without dual-booting another operating system.
- You use either a physical or a virtual x86 64 bit machine which is capable booting in either BIOS or EFI mode.
- You use an Intel CPU.
- Your desired root filesystem is BTRFS.
- Boot into Arch Linux live installation media. Make sure that you know which disk is used for your
installation. We'll assume it's
/dev/sda
. - If you're using Wifi, launch
wifi-menu
. You're network should be automatically configured if you're using wired network. - Optional - You can launch an SSH server and continue your installation remotely from another
computer. In order to do that:
- Set a root password using
passwd
- Start the SSH server using
systemctl start sshd
- Figure out your IP using
ip a
- SSH to your installation disk from another computer and continue the installation as usual.
- Set a root password using
- Partition your disk:
- BIOS - Just
mkfs.btrfs /dev/sda
the entire disk and thenmount /dev/sda /mnt
- EFI - Use
cfdisk
for partitioning:- Choose GPT partitioning
- Create a 512MiB partition. Set its type to
EFI System
- Create a partition for the rest of the drive.
mkfs.vfat -F32 /dev/sda1
mkfs.btrfs /dev/sda2
mount /dev/sda2 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
- BIOS - Just
pacstrap /mnt base intel-ucode sudo btrfs-progs
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
- Uncomment
en_US.UTF-8
and other needed localizations in/etc/locale.gen
locale-gen
- Edit
/etc/locale.conf
and writeLANG=en_US.UTF-8
- Networking
- Laptop - Use NetworkManager
pacman -S networkmanager
systemctl enable NetworkManager
- Once you have a GUI environment set up - configure the network using the GUI
- PC/VM - Use systemd-networkd
systemctl enable systemd-{network,resolve}d
- Use
ip link
to determine the name of your network interface - Edit
/etc/systemd/network/dhcp.network
:
[Match] Name=en* [Network] DHCP=ipv4 Domains=extra.domains.that.you.need.example.com [DHCP] UseDomains=yes
rm /etc/resolv.conf ; ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
- Laptop - Use NetworkManager
echo hostname > /etc/hostname
passwd
- Set the root passworduseradd -m your_username
usermod -G wheel -a your_username
visudo
- Comment out the line containing thewheel
group- Install the bootloader
- BIOS - GRUB
pacman -S grub
grub-install --target=i386-pc /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
- EFI - systemd-boot
bootctl --path=/boot install
- Edit
/etc/pacman.d/hooks/systemd-boot.hook
:[Trigger] Type = Package Operation = Upgrade Target = systemd [Action] Description = Updating systemd-boot... When = PostTransaction Exec = /usr/bin/bootctl update
- Edit
/boot/loader/loader.conf
:default arch timeout 4
- Figure out your root UUID By running
blkid
- Create
/boot/loader/entries/arch.conf
title Arch Linux linux /vmlinuz-linux initrd /intel-ucode.img initrd /initramfs-linux.img options root=PARTUUID=THE-UUID-YOU-FOUND-OUT rw
- BIOS - GRUB
- Leave chroot -
exit
- If this is a server installation you might want to enable SSH before rebooting. See the instructions at the bottom.
- Reboot -
systemctl reboot
pacman -S gnome && systemctl enable --now gdm
pacman -S openssh && systemctl enable --now sshd.socket
Building packages from AUR isn't possible to do as root. In order to install Yay you have to configure sudo and run these commands as a regular user.
sudo pacman -S --needed base-devel git
cd /tmp
git clone https://aur.archlinux.org/yay-bin.git && cd yay-bin && makepkg -i && cd - && rm -rf yay-bin