Arch Linux Install
This guide is meant to be a little bit faster and easier to follow than the official documentation. We also try to keep all the essentials in one place so you don’t have to follow too many links just to get your system up and running. The offical install doc doesn’t include everything you need to configure the network, bootloader, and some important packages. You should check out the official install guide even if you just plan on following the instructions here. The offical Arch Linux install guide can be found here: https://wiki.archlinux.org/index.php/Installation_guide
You can watch the video here or keep scrolling to read the guide on this page.
Download Install Media
Downloads can be found here: https://www.archlinux.org/download/
You can download with BitTorrent if you like. Many people recommend using BitTorrent. My BitTorrent download froze halfway through so I just used an HTTP download from one of the mirrors. It worked great and downloaded in just a few minutes.
Verify the GnuPG Signature
gpg --keyserver-options auto-key-retrieve \
--verify archlinux-version-x86_64.iso.sig
Use the signature from archlinux.org and not one of the mirrors as the signature on a mirror is more likely to have been tampered with.
Create a USB Install Disk
If you are already running Linux, you can create a Live install USB disk like this:
dd bs=4M if=/home/user/archlinux-2018.01.01-x86_64.iso \
of=/dev/sdc status=progress && sync
Boot From Your Install Media
You will be logged into a virtual console as root by default. Your shell will be Zsh.
These text editors are available:
- nano
- vi
- vim
Note:
- You will also have the ELinks browser avialable.
- You can switch to different virtual consoles with the [Alt]+[Arrow] key combo.
NOTE - You can view the install guide while installing like this:
vi install.txt
Keyboard Layout:
The default keyboard layout is US. If you want to change it you can do this:
ls /usr/share/kbd/keymaps/**/*.map.gz
loadkeys de-latin1
Verify Boot Mode
If this file exists, the system is going to boot in UEFI mode. If it doesn’t exist, it may boot up in BIOS or CSM mode.
ls /sys/firmware/efi/efivars
Network Setup
NOTE - This is for your connection DURING the install.
DHCP will be enabled by default for wired connections. If this is what you want, you should be all set and can skip the rest of this section. Otherwise, you might need to manually configure networking. You can configure a static IP address if you like.
Check here for more info: https://wiki.archlinux.org/index.php/Network_configuration
Show network interfaces:
ip link
ip addr
If you are using DHCP, you should be all set. If not, here is the basic syntax you will need to bring up a network interface and add any needed routes. The example assumes the following:
- Device name: enp0s3
- IP: 192.168.1.5
- Netmask: 255.255.255.0
- Default GW: 192.168.1.1
- Google DNS: 8.8.8.8
ifconfig enp0s3 192.168.1.5 netmask 255.255.255.0 up
route add default gw 192.168.1.1
echo "nameserver 8.8.8.8" > /etc/resolv.conf
WIFI
If you are using WIFI, you can get your device name from the command above. Run the following command to configure WIFI:
wifi-menu -o wlo1
Verify
Verify that you have connectivity by pinging archlinux.org:
ping archlinux.org
Time and Date
Make sure the system has the correct time and date:
timedatectl set-ntp true
Verify that the service is working:
timedatectl status
Disks
List out your available disk devices.
lsblk
fdisk -l
You can optionally setup RAID, LVM, and encryption. We will cover this separately.
Disk Partitioning
Required partitions:
- / partition
- EFI system partition ( if UEFI is enabled )
You usually also want a swap partition. Sometimes you may potentially want other partitions as well.
Other Partitions ( like /var ):
You probably want to keep things simple but there are plenty of use cases for creating additional partions. The most common addtion would be to create a separate partition for /var. This has the advantage of not impacting your system as much if the partition fills up. This makes sense for /var because this is usually where your logs and other variable length data will go. This also makes it easier to replace or expand the disk later, if needed.
Basic Partition Layout
This is a basic example of how you will probably want to layout your partitions. This is a minimal setup. Swap is optional but people almost always include this.
I’ve basically copied this table from the Official Arch docs:
BIOS with MBR
Mount point | Partition | Partition type | Suggested size |
---|---|---|---|
/ | /dev/sdX1 | Linux | Remainder of the device |
[SWAP] | /dev/sdX2 | Linux swap | More than 512 MiB |
UEFI with GPT
Mount point | Partition | Partition type | Suggested size |
---|---|---|---|
/boot or /efi | /dev/sdX1 | EFI system partition | 260–512 MiB |
/ | /dev/sdX2 | Linux x86-64 root (/) | Remainder of the device |
[SWAP] | /dev/sdX3 | Linux swap | More than 512 MiB |
Use fdisk or parted to modify the partition tables ……..
NOTE - You can use a swap file instead of a swap partition.
Partitioning With Fdisk
Here is a table of important commands I jused in this example:
m | view a list of comands |
p | print disk / partition info |
n | create new partition |
l | list known partition types |
t | change partition type |
w | write the partion table |
a | set bootable flag |
Here are the actual commands, sub-commands, and parameters I used:
fdisk /dev/sda
m
p
n
p
1
[enter]
+512M
p
l
t
82
p
n
p
2
[enter]
[enter]
a
2
w
Let’s start up fdisk:
The first thing we do is view the existing partitions ( none ). To do this we use the ‘p’ command.
Next, we will take a quick look at what existing commands are available using ‘m’.
The first change we actually want to make is to create a new swap partition.
After creating our first new partition we want to see what it looks like. Use the ‘p’ command to print it out again. Notice that it is the ** wrong type ** . We can fix this.
We are going to need to change the partition type. Before we do this we need to lookup what type we actually want. Do this using the ‘l’ command. You will see that Linux swap is 82.
Now let’s use the ‘t’ command to change the partition type to 82.
Next, we’re going to create a new root partition. This one should be the correct type by default.
Now let’s print out our finished partition table.
Looks like we still need to make the root partition bootable. Lets do that using the ‘a’ command like this.
We want to make sure to write this to disk using the ‘w’ command.
That’s it! We’ve partitioned our disk.
Disk Formatting
IMPORTANT NOTE - In this example, I actually put the swap partition on /dev/sda1 and the / partition on /dev/sda2.
Format the the root file system ( assuming it is on /dev/sda1 ):
mkfs.ext4 /dev/sda2
Initialize and turn on your swap partition ( assuming /dev/sda2 ):
mkswap /dev/sda1
swapon /dev/sda1
Temporarily mount your root partition on /mnt so that it is ready for installation:
mount /dev/sda2 /mnt
Also, mount any other filesystems you created on /mnt, for example:
mount /dev/sda3 /mnt/efi
These will be detected later.
Installation
Optionally, edit this file and place your preferred mirror at the top:
vi /etc/pacman.d/mirrorlist
It will be used during installation and by the package manager after install.
Install Essential Packages
This will install:
- the base package
- the Linux kernel
- some firmware for common hardware
pacstrap /mnt base linux linux-firmware
Fstab and Chroot
Filesystem Table ( /etc/fstab )
Generate your filesystem table:
genfstab -U /mnt >> /mnt/etc/fstab
Chroot
Chroot into into your new system. This will mount the root fs of your new system over / so you can operate on it as you would after installation.
arch-chroot /mnt
Software Installation
These are package that we thought should be installed during the system installation. Often times Arch Linux users install them after system install.
Important Packages
These are packages that really should be on any Linux system.
Important / Semi-critical:
pacman -S man-pages man-db dnsutils ethtool \
iputils net-tools iproute2 openssh wget \
usbutils usb_modeswitch tcpdump \
smartmontools gnu-netcat
Nice to have:
pacman -S mc dosfstools exfat-utils ntfs-3g \
partclone parted partimage gptfdisk
Note:
- iputils - ping and other utils
- net-tools - old, deprecated ( but nice to have anyway )
- iproute2 - replacement for net-tools
Install WIFI Software
Install these packages if you want to be able to use WIFI. WPA supplicant has a lot of features and is included in the ISO. We’re going to use this tool.
pacman -S iw wpa_supplicant dialog
Development Software
It is always a good idea to have development software installed. This includes compilers and other tools.
pacman -S base-devel
Install VIM
You are going to need vim to finish the installation anyway. Also, while you are at it, create a link so that when you type ‘vi’ it will run ‘vim’.
pacman -S vim
cd /usr/bin/
ln -s vim vi
System Configuration
Time Zone
# ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
This will generate /etc/adjtime and assumes your hardware clock is set to UTC:
hwclock --systohc
Edit your /etc/locale.gen file. You will want to add en_US.UTF-8, UTF-8, and any other locales yiou might want.
For example, just uncomment this line:
vi /etc/locale.gen
en_US.UTF-8 UTF-8
Generate your locales:
locale-gen
Edit /etc/locale.conf and set the lang:
vi /etc/locale.conf
LANG=en_US.UTF-8
Edit /etc/vconsole.conf to make any changes persistent.
/etc/vconsole.conf
KEYMAP=de-latin1
Network Configuration
The official Arch Linux network documentation can be found here:
https://wiki.archlinux.org/index.php/Network_configuration
Create / edit your hostname file:
vi /etc/hostname
myhostname
Edit your /etc/hosts file, assuming a static IP of 192.168.0.25. This may be different for you. If you are using DHCP you can just set this to 127.0.0.1 too.
vi /etc/hosts
127.0.0.1 localhost
::1 localhost
192.168.0.25 myhostname.localdomain myhostname
Persistent Network Config
If you want your network configuration to persist, you can either create a script / systemd combo that configures the interfaces or use a network manager. We’re going to show you how to use a network manager. There are many different choices of network managers. We are going to use systemd-networkd here.
DNS Settings
Personally, I would recommend using these settings in your resolv.conf file regardless of whether or not you are using DHCP or static network configuration. I generally trust Google’s DNS servers (8.8.8.8 and 8.8.4.4).
vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
Choose either DHCP or Static:
DHCP
vi /etc/systemd/network/20-wired.network
[Match]
Name=enp1s0
[Network]
DHCP=ipv4
Static IP
vi /etc/systemd/network/20-wired.network
[Match]
Name=enp1s0
[Network]
Address=10.1.10.9/24
Gateway=10.1.10.1
DNS=10.1.10.1
DNS=8.8.8.8
Network Manager
Enable the network manager. The two commented commands shouldn’t be used during install if you already have an established connection but might come in handy later.
systemctl enable systemd-networkd
#systemctl start systemd-networkd
#systemctl status systemd-networkd
Wifi
The official Arch Linux Wireless Network Configuration documentation can be found here: https://wiki.archlinux.org/index.php/Network_configuration/Wireless
You can configure the interface like this:
vi /etc/systemd/network/25-wireless.network
[Match]
Name=wlp2s0
[Network]
DHCP=ipv4
User Setup
Root Password
passwd
Add a User Account
useradd -m -G wheel,users -s /bin/bash user1
passwd user1
Boot Loader
You have a bunch of options for a boot loader. Two popular options are GRUB and systemd-boot.
We’re going to cover GRUB here because I like it.
GRUB
Here we assume you are using /dev/sda. If your system is installed on another disk, use that.
pacman -Sy grub os-prober
mkdir /boot/grub
grub-mkconfig -o /boot/grub/grub.cfg
grub-install /dev/sda
If you want ot learn more, the offical Arch Linux GRUB docs are here: https://wiki.archlinux.org/index.php/GRUB
Microcode
Linux has the abiltiy to apply CPU microcode updates. This is important for buggy CPUs. You only need either Intel or AMD microcode depending on which CPU you have. You can load both if you want which is a good idea if you are building a system on a USB drive that may run on a system with either CPU. We just add both here:
pacman -S intel-ucode amd-ucode
grub-mkconfig -o /boot/grub/grub.cfg
Reboot
Exit the chroot environment and reboot:
exit
reboot
Make sure you remove the install media before the system starts back up.
Post Boot
I personally like to make sure that ‘set-ntp’ is set to true to make sure the new system has the correct time and date. Verify that the service is working.
timedatectl set-ntp true
timedatectl status
What Next?
You might want to take a look at these:
- https://wiki.archlinux.org/index.php/General_recommendations
- https://wiki.archlinux.org/index.php/List_of_applications
Here is my old video with bad sound and no X Windows in case you want to watch it: