This step by step guide shows how to install Arch Linux from USB flash drive or cd. In my opinion the beginner tutorial from Arch wiki is too complicated for beginners. This is made simple and very practical, with some basic knowledge about partitions and Linux you should have no problems.
Create Arch USB flash drive:
Download Arch Linux latest dual iso from https://archlinux.org/download/.Run this command to write the iso to your USB flash drive. Make sure /dev/sdb is your usb, this can be dangerous, you might overwrite some other disks. You can use gparted to find your usb and also delete any partitions beforehand.
Source code viewer
sudo dd bs=4M if=~/Downloads/archlinux-2022.06.01-x86_64.iso of=/dev/sdb && syncProgramming Language: Bash
Install the base environment
https://wiki.archlinux.org/title/Installation_guide
Or follow my short installation guide (I suggest to use both, if you are a first timer):
- Start Arch from USB to install it.
- Pick 64 bit (x86_64) or 32 bit (i686) when you have old dual iso instead of x86_64.
Make sure you have internet connection by running ping (optional).
Source code viewer
# Your drive is probably /dev/sda or /dev/nvme0n1. sgdisk --zap-all /dev/sda cgdisk /dev/sda # NB: Create partitions based on the table below! # "Write" to apply the changes to disk. # "Quit".Programming Language: Bash
Mount point | Partition | Partition type | Suggested size |
---|---|---|---|
/mnt/boot | /dev/efi_system_partition | EFI system partition | At least 300 MiB |
SWAP (Optional) | /dev/swap_partition | Linux swap | More than 512 MiB |
/mnt | /dev/root_partition | Linux x86-64 root (/) | Remainder of the device |
Source code viewer
# Single-partition setup: mkfs.ext4 /dev/root_partition mkswap /dev/swap_partition mkfs.fat -F 32 /dev/efi_system_partitionProgramming Language: Bash
Source code viewer
# Single-partition setup: mount /dev/root_partition mount --mkdir /dev/efi_system_partition /mnt/boot swapon /dev/swap_partitionProgramming Language: Bash
- Ethernet—plug in the cable.
- Wi-Fi—authenticate to the wireless network using iwctl.
- Mobile broadband modem—connect to the mobile network with the mmcli utility.
Source code viewer
pacstrap /mnt base linux linux-firmwareProgramming Language: Bash
Source code viewer
genfstab -U /mnt >> /mnt/etc/fstabProgramming Language: Bash
Source code viewer
arch-chroot /mntProgramming Language: Bash
Source code viewer
ln -sf /usr/share/zoneinfo/Region/City /etc/localtimeProgramming Language: Bash
Source code viewer
hwclock --systohcProgramming Language: Bash
Source code viewer
mkinitcpio -PProgramming Language: Bash
Source code viewer
passwdProgramming Language: Bash
Source code viewer
pacman -S grub efibootmgr grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB grub-mkconfig -o /boot/grub/grub.cfgProgramming Language: Bash
Source code viewer
exit rebootProgramming Language: Bash
Enable bash autocomplete (Recommended):
Source code viewer
pacman -S bash-completionProgramming Language: Bash
Enable internet (Recommended):
Source code viewer
ip link ip link set up dev enp2s0 systemctl enable dhcpcd systemctl start dhcpcd systemctl enable NetworkManager systemctl start NetworkManagerProgramming Language: Bash
Choose your drivers (Recommended):
Source code viewer
# Detect your videocard. lspci -v | grep -A1 -e VGA -e 3D # Nvidia - first search and then install the corresponding one pacman -Ss nvidia pacman -S nvidia # Intel pacman -S xf86-video-intel # Radeon pacman -S xf86-video-atiProgramming Language: Bash
Source code viewer
pacman -S sudo useradd -m -g users -G wheel -s /bin/bash USERNAME passwd USERNAME # If you wish to use sudo command: visudo # Uncomment "%wheel ALL=(ALL) ALL", if you wish to be added to sudoers since you have been added to group wheel.Programming Language: Bash
Locale (Recommended):
Source code viewer
nano /etc/locale.gen # Uncomment: en_US.UTF-8 UTF-8 locale-gen echo LANG=en_US.UTF-8 > /etc/locale.confProgramming Language: Bash
Set repositories (Recommended):
Final step would be to install yaourt and use it instead of pacman. It includes pacman + user repositories. You will be amazed what you can get from Arch User Repositories (AUR). Also enable multilib so you can download programs like skype or wine that require 32bit packages if you are using 64bit version.Source code viewer
# 1. Open repositories configuration. nano /etc/pacman.conf # 2. Uncomment both two lines of the [multilib] section for 32-bit packages. # 4. Refresh repositories. pacman -Syu # 5. Install yay package manager for AUR package management. pacman -S git base-devel git clone https://aur.archlinux.org/yay.git cd yay makepkg -siProgramming Language: Bash