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 EFI mode. Note that if you use a virtual machine then you'll probably have to check the EFI option somewhere.
- You use an Intel CPU.
- Your desired root filesystem is XFS.
- Disable "Secure Boot" in the BIOS.
- 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
. You can useblkid
to list block devices. - 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:
- Run
cfdisk
for partitioning - Choose GPT partitioning (if you don't get the option to choose ,please run
cfdisk -z
) - Create a 512MiB partition. Set its type to
EFI System
- Create a swap partition. 4GiB will probably do. Set its type to
Linux Swap
- Create a partition for the rest of the drive. (that should create /dev/sda3)
mkswap /dev/sda2
swapon /dev/sda2
mkfs.vfat -F32 /dev/sda1
mkfs.xfs /dev/sda3
mount /dev/sda3 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
- Run
pacstrap /mnt base intel-ucode sudo linux linux-firmware xfsprogs neovim
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
(you can see all the options in wiki timezones list)- 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 - Use NetworkManager
pacman -S networkmanager
systemctl enable NetworkManager
- Once you have a GUI environment set up - configure the network using the GUI
echo [YOUR HOSTNAME] > /etc/hostname
passwd
- Set the root passworduseradd -m <your_username>
usermod -G wheel -a <your_username>
passwd <your_username>
- Set the user passwordEDITOR=nvim visudo
- Uncomment the line containing thewheel
group- Install the bootloader - 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
:timeout 4 default arch
- Figure out your root partition's UUID By running
blkid
. This should probably be the UUID of /dev/sda3 - Create
/boot/loader/entries/arch.conf
. Replace<PUUID>
(NOT<UUID>
) with the PARTUUID that you got from runningblkid
. Note that the UUID is case sensitive.title Arch Linux linux /vmlinuz-linux initrd /intel-ucode.img initrd /initramfs-linux.img options root=PARTUUID=<PUUID> rw
- 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
- Once your system is up activate NTP by running
timedatectl set-ntp on
- If needed, connect to wifi by running
nmcli device wifi connect <SSID> password <password>
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
pacman -S gnome && systemctl enable --now gdm
pacman -S sddm plasma-meta kdebase-meta kdeutils-meta kdegraphics-meta && systemctl enable --now sddm
pacman -S openssh && systemctl enable --now sshd.socket