This is a guide about how to install Arch Linux from start to finish in one place. If you follow these steps you will end up with an clean install of Arch Linux without any graphical environment.
- Check if you have a UEFI system:
$ ls /sys/firmware/efi/efivars
-
If the command shows you the directory without any error, then you have a UEFI system. But you may still be able to follow this guide to some extent.
-
If you got an error that looks like this, then you are good to go and can follow this guide.
ls: cannot access '/sys/firmware/efi/efivars': No such file or directory
-
-
Find keyboard layout:
$ ls /usr/share/kbd/keymaps/**/*.map.gz
-
Set the keyboard layout example:
$ loadkeys sv-latin1
-
Enable the network interface:
$ ip link
-
Verify that it works:
$ ping pigges.xyz
-
Enable the clock service:
$ timedatectl set-ntp true -
Check the service status:
$ timedatectl status
-
Check what disks are connected:
$ lsblk
Example for lsblk:
-
Enter fdisk:
$ fdisk /dev/sda
- Example partition layout for a 100GB disk:
NAME SIZE TYPE MOUNT sda 100Gdisk ├─sda1 200Mpart /boot├─sda2 12Gpart [SWAP]├─sda3 30Gpart /└─sda4 57.8Gpart /home
- Example partition layout for a 100GB disk:
-
Make filesystem for all the partitions exept for the
SWAPpartition:$ mkfs.ext4 /dev/sdaX
-
Make and enable
SWAP:$ mkswap /dev/sda2 $ swapon /dev/sda2
-
Mount the root partition to
/mnt:$ mount /dev/sda1 /mnt
-
Create directories for partitions:
$ mkdir /mnt/boot $ mkdir /mnt/home
-
Mount the other partitions
$ mount /dev/sda1 /mnt/boot $ mount /dev/sda4 /mnt/home
$ pacstrap /mnt base base-devel linux linux-firmware nano-
Generate an fstab file:
$ genfstab -U /mnt >> /mnt/etc/fstab -
Chroot into the disk
$ arch-chroot /mnt
-
Check Region and City:
$ ls /usr/share/zoneinfo # Get the REGION $ ls /usr/share/zoneinfo/REGION # Get the CITY
-
Set Region and City
$ ln -sf /usr/share/zoneinfo/REGION/CITY /etc/localtime
-
Run hwclock to generate
/etc/adjtime:$ hwclock --systohc
-
Edit
/etc/locale.genand uncomment the locales you may need:$ nano /etc/locale.gen
Example for
/etc/locale.gen:en_US.UTF-8 UTF-8 sv_SE.UTF-8 UTF-8 -
Generate the locales:
$ locale-gen
-
Create and setup the
/etc/locale.conffile:$ nano /etc/locale.conf
Example for
/etc/locale.conf:LANG=en_US.UTF-8 -
Set keyboard layout:
$ nano /etc/vconsole.conf
Example for
/etc/vconsole.conf:KEYMAP=sv-latin1
-
Install and enable
networkmanager:$ pacman -S networkmanager $ systemctl enable NetworkManager -
Create the
/etc/hostnamefile:$ nano /etc/hostname.conf
Example for
/etc/hostname:archvm -
Edit the
/etc/hostsfile:$ nano /etc/hosts
Example for
/etc/hosts: Change "archvm" to your hostname# Static table lookup for hostnames. # See hosts(5) for details. 127.0.0.1 localhost ::1 localhost 127.0.1.1 archvm.localdomain archvm
- Set a root password
$ passwd
-
Install
grub$ pacman -S grub $ grub-install --target=i386-pc /dev/sda
-
Configure
grub$ grub-mkconfig -o /boot/grub/grub.cfg
-
If you get this warning:
Warning: os-prober will not be executed to detect other bootable partitions. Systems on them will not be added to the GRUB boot configuration. Check GRUB_DISABLE_OS_PROBER documentation entry. doneEdit the
/etc/default/grubfile:$ nano /etc/default/grub
Then run this again:
$ grub-mkconfig -o /boot/grub/grub.cfg
-
-
Create the user:
useradd -m -G wheel user #change user -
Set a user password:
$ passwd user
-
Edit the
sudoconfig so users of thewheelgroup can use sudo:$ EDITOR=nano visudo
- Find the line where it says "
# %wheel ALL=(ALL) ALL" and uncomment it.
- Find the line where it says "
-
Exit from
chroot:$ exit -
Unmount the disk:
$ umount -R /mnt
-
Shutdown the computer:
$ shutdown now
You can now remove the install media and boot into your newly made arch install and be prompted with a login.
| BTW I use Arch |
|---|
![]() |


