Welcome to Arch Linux Environment Setup How-to. Arch Linux is a very flexible distribution and this book will guide you to the point where you can get a basic system in place. From there on you can go in any direction you want. A simple server, a full-blown desktop system with all the bells and whistles. In the end, Arch Linux is always what you make of it.
These days the installation of Arch Linux might look like a work of insanity, as there is no installer available in the official media, just a guideline to follow. The installation without an installer is as easy as it can be. For experienced users, installing without an installer is even more convenient. The newest ISOs require that you have your machine connected to the Internet, as there are no longer packages available on the installation media.
You can get the official ISO image file from https://www.archlinux.org/download/. On this page you will find a download link to the latest release. Depending on your preference, download the torrent file or the ISO image file immediately.
The following list describes the main tasks that we will perform in this recipe:
/mnt. The other partitions will be mounted later on after you have created the specific folders. We'll designate our device with /dev/sdX; in your case this can be /dev/sda, and so on.base install is adding base-devel to the default installation. For normal end users, just base will be sufficient to start.The following steps will guide you in preparing, booting, and setting keyboard layout:
sha1sums.txt file from the download page.sha1sum -c sha1sums.txt command and you'll see whether your download was successful or not. Also check if the signature of the ISO is correct by running gpg -v archlinux-...iso.sig:sha1sum -c sha1sums.txt gpg -v archlinux-2012-08-04-dual.iso.sig
The following screenshot shows the execution of this step:


/usr/share/kbd/keymaps/.loadkeys keyboardlayout.Now let's perform the following steps to create, format, and mount partitions:
cfdisk /dev/sdX cgdisk /dev/sdX
mkfs command to create a filesystem on a specific partition:mkfs -t vfat /dev/sdX mkfs.ext4 -L root /dev/sdX
/mnt:
mount /dev/sdX3 /mnt
mount for your other partitions:
mkdir -p /mnt/boot
mount /dev/sdX1 /mnt/boot
The following steps are needed to connect to the Internet:
netcfg mywireless.The following steps should be performed for installing the base system and boot loader:
pacstrap /mnt base base-devel
We'll now list the steps to do during the configuration:
fstab with genfstab:
genfstab -p /mnt >> /mnt/etc/fstab
arch-chroot /mnt
/etc/hostname./etc/localtime symlink./etc/locale.conf./etc/locale.gen.locale-gen./etc/mkinitcpio.conf.
mkinitcpio -p linux
passwd.exit).We downloaded the ISO image file via torrent, or via HTTP from the mirror sites listed on the download page. The sha1sum command lets us verify the integrity of the downloaded ISO. On top of the checksum, we can also check the integrity by verifying the signature available for the ISO. So now, we can rest assured that the downloaded file is the real one. The ISO contains a fully working operating system. It also contains all the necessary tools to perform system recovery and installation.
The keyboard configuration set with loadkeys will make sure that the key you press on your keyboard will be translated to the correct letter on your screen. Using a different keyboard layout from the one on your physical keyboard might be confusing.
We then created a partition scheme on the selected disk with the appropriate tool (cfdisk or cgdisk). Make Filesystem (mkfs) is a unified frontend to create a filesystem. Using it we created our filesystem layout manually under /mnt by creating our default partition layout in our root, and mounting the specific partitions accordingly.
You can make a connection with your wireless network (if needed), and then use dhcpcd or dhclient to obtain an IP address that enables you to access the Internet.
Pacstrap will run pacman with a modified root location to install the desired packages into the newly created system.
For example, installing Syslinux:
pacstrap /mnt syslinux
The specific configuration files will ensure we don't have to do all those steps over and over again on every boot.
You can use the official ISO directly from the USB stick if you prefer. There might be some issues with the verification of the ISO. The next two sections discuss them and provide you with the solution.
The ISOs downloaded for Arch Linux are all 'hybrid' images, which means you can put them on a USB drive and they will be bootable. So installing from a USB drive is also very simple. Place a USB drive in your machine (warning: it will lose all its data) and issue the following command:
dd if=archlinux-2012.08.04-dual.iso of=/dev/sdX bs=1M
When you don't have the signer's public key in your gpg keyring you will get an error like gpg: Can't check signature: No public key. This means you will first have to import the signer's public key before verification of the signature is possible:
gpg --keyserver wwwkeys.pgp.net --recv-keys 0x9741E8AC
Import the public key, in this case the public key of Pierre Schmitz. Then you can run the verification of the ISO again. The verification should now give you gpg: Good signature from "Pierre Schmitz <pierre@archlinux.de>". When you have done the steps described here, you will get a warning that the key is not certified with a trusted signature. In the case of verifying the integrity of the ISO, this is of no importance. For more information about GPG and signatures, see http://www.gnupg.org/.
The next section talks about a common sample of a good desktop partition scheme.
On a desktop system, especially Arch Linux, I personally suggest having a separate /var partition. Depending on the other goals you might have for this partition (for example, running a huge MySQL database, other databases, and so on), a sensible value would be 5 GB and above. Don't overdo it or you will have a lot of empty space in the /var partition. Why make /var so big? Pacman keeps its cache in /var, and you don't really want your root filesystem being deadlocked by a filled up disk with package cache.
The netcfg tool originally developed by Arch Linux provides us with tons of options, which we will discuss in the next section.
The sample configurations can be found in the /etc/network.d/examples folder. In the following table, we have given a list of sample configurations provided by the netcfg package:
|
Connection type |
Example profile |
|---|---|
|
Wireless/WEP hex key |
|
|
Wireless/WEP string key |
|
|
Wireless/WPA-Personal (passphrase/preshared key) |
|
|
Wireless/WPA-Enterprise |
|
|
Wired/DHCP |
|
|
Wired/static IP |
|
|
Wired/iproute configuration |
|
If you prefer the use of UUID or label in your fstab file, you can pass an extra parameter to the genfstab script: U for UUID or L for labels.
The final installation of Syslinux has to be done from within the chrooted environment.
/usr/sbin/syslinux-install_update -iam
Should the previous command fail while trying to set the boot flag, use the following command:
/usr/sbin/syslinux-install_update -im
After a successful installation of Syslinux, configure the way your system will boot by editing /boot/syslinux/syslinux.cfg.