Arch Linux 2014.05.01 Released – Installation and Configuration Guide with Screenshots
Arch Linux is one of the most versatile GNU Linux distribution ever for its simplicity and cutting age software packages due to its Rolling Release model but is not addressed for beginners in Linux world due to its kind of complicated installer which does not provide a Graphical Interface, only the command line which also makes the job of installing the system very flexible.
On top of all, Arch Linux provides its own software packages through Pacman Package Manager with the latest updates on security and applications with full dependency check, a Multiarch environment for different CPU Architectures – x32, x64 and ARM.
Also Arch Linux maintains AUR – Arch User Repository a huge community driven software repositories which allows to compile software from sources and install it via Pacman or Yaourt (Yet Another User Repository Tool).
This tutorial presents a step by step basic smooth Arch Linux installation process through a CD/USB bootable image. For other customizations or details visit Official Arch Linux Wiki page at https://wiki.archlinux.org.
Step 1: Create Disk Partitions Layout
1. First of all go do Arch Linux download page https://www.archlinux.org/download, grab the latest CD image (i.e. current stable version: 2014.05.01), create a bootable CD/USB then plug it into your system CD/USB drive.
2. IMPORTANT STEP! Also make sure your system has an Ethernet plugged in cable with internet connectivity and also an active DHCP server enabled.
3. After the CD/USB boots up you will be presented with first Arch Linux Installer options. Choose your CPU Architecture type and press Enter key.
4. After the installer decompresses and loads the Linux Kernel you will be automatically thrown to an Arch Linux Bash terminal (TTY) with root privileges. A good step now is to verify your network connection and Hard Drives by issuing the following commands.
# ping –c3 google.com # fdisk –l
5. The next step is to chunk and prepare your Hard Disk partitions. For this stage you can use Fdisk or Cfdisk utilities to perform a disk partition layout for MBR disks or Gdisk for GPT disks. I recommend Cfdisk for its guidance and simplicity in use.
For a basic layout partition table use the following structure.
- Root partition (/dev/sda1) with at least 20G size as Primary with Boot flag, ext4 formatted.
- Swap partition (/dev/sda2) with 2xRAM size as Primary, Swap On.
- Home partition (/dev/sda5) with the rest of space as Extended, ext4 formatted.
Now let’s actually start creating disk layout partition table by running cfdisk command, select Free Space then hit on New (this will be the system ROOT partition).
6. Select Primary as type, enter partition Size in MB (20000), create partition at the Beginning of Free Space and mark it as Bootable as in the following screenshots.
7. For Swap use down arrow key and select again the remaining Free Space and repeat the steps above: New -> Primary, 2xRAM as size -> Beginning.
8. For Home partition use the following configuration: New -> Logical -> Enter for size (this will use the remaining Free Space). After you review Partition Table select Write, answer with yes, then Quit to exit cfdisk utility.
9. For now your partition table has been written to HDD MRB but no file system was yet created on top of it. You can also get a better partition table review by running fdisk –l command again.
# fdisk -l
Now is time to create disk file system and format partitions with ext4. Issue the following commands for ROOT and HOME partitions.
# mkfs.ext4 /dev/sda1 # mkfs.ext4 /dev/sda5
Format and initialize SWAP partition.
# mkswap /dev/sda2 # swapon /dev/sda2
10. Now run lsblk command to double check partitions and make sure everything is in correctly configured so far.
Step 2: Install Arch Base System
11. For performing an Arch Linux installation the two partitions created must be mount it on Arch Live running system to a mount point to be accessible. For this setup I shall use the /mnt Arch system live path to mount ROOT partition (/dev/sda1) and /mnt/home path to mount HOME partition (/dev/sda5). Don’t be worried about SWAP partition (it’s has already been initialized above). Use the following commands in the following order for this step.
# mount /dev/sda1 /mnt # mkdir /mnt/home # mount /dev/sda5 /mnt/home
12. After the partitions had been made accessible, is time to perform Arch Linux system installation. For a better packages download installation speed edit /etc/pacman.d/mirrorlist file by searching and selecting your closest mirror website ( usually choose your country server location) on top of mirror file list.
# nano /etc/pacman.d/mirrorlist
13. Install Arch Linux by issuing the following command and hit Enter key on both packages selection (default=all).
# pacstrap -i /mnt base base-devel
Depending on your system physical configuration and internet speed the installer can take from 5 to 20 min to complete. So, if you have nothing else to do you can watch the installer on how it performs.
14. After all packages are installed it’s time to generate fstab file for our new Arch Linux system to be able to boot from newly partitions with the help of the following command.
# genfstab -U -p /mnt >> /mnt/etc/fstab
If there are any errors concerning this command you must open and manually edit fstab or else your system will not be able to boot properly.
# nano /mnt/etc/fstab
To get those Partitions UUID run blkid command.
Step 3: System Configuration
15. To configure Arch Linux you must chroot (some kind of jail) into your newly installation path which is /mnt by running the following command.
# arch-chroot /mnt
To get rid of that ugly shell, run /bin/bash shell interpreter.
16. First step now, is configuring System Language. Choose and uncomment your preferred encoding languages from /etc/locale.gen file then set your locale by running the following commands.
# nano /etc/locale.gen
locale-gen echo LANG=en_US.UTF-8 > /etc/locale.conf export LANG=en_US.UTF-8
17. Next step is to configure your system time zone by creating a symlink for your sub time zone ( /usr/share/zoneinfo/Continent/Main_city ) to /etc/localtime path.
# ls /usr/share/zoneinfo/ # ln -s /usr/share/zoneinfo/Europe/Bucharest /etc/localtime
You can also configure hardware clock to use UTC (your distribution knows that your hardware clock is set to the local time).
# hwclock --systohc --utc
18. As many widely famous Linux distributions, Arch Linux uses its own repository mirrors for different world locations and multiple system architectures. The standard repos are enabled by default but to activate Multilib repositories on x64-bit, uncomment [multilib] directive from /etc/pacman.conf file.
# nano /etc/pacman.conf
19. To activate Yaourt Package Tool (downloading and building AUR packages) go to bottom of the same /etc/pacman.conf file and add the following directives.
[archlinuxfr] SigLevel = Never Server = http://repo.archlinux.fr/$arch
20. After the repositories had been edited, is time to synchronize and update database packages using the following command.
# pacman -Syu
21. Now it’s time to add a password for root account and create a new user with sudo privileges on Arch box by issuing the commands below.
# passwd # useradd -mg users -G wheel,storage,power -s /bin/bash your_new_user # passwd your_new_user
22. After the newly user has been added install sudo package.
# pacman -S sudo
23. To allow users in wheel group to perform administrative tasks open end edit /etc/sudoers file and uncomment “%wheel ALL=(ALL) ALL” line.
# sudo visudo OR # nano /etc/sudoers
24. The last step is to install the Boot Loader in order for Arch to boot up after restart. The default boot loader for many Linux environments and Arch also is represented by GRUB package. To install boot loader on first system hard-disk and detect Arch and other systems on a multiboot environment run the following commands
# pacman -S grub # grub-install /dev/sda # pacman -S os-prober # grub-mkconfig -o /boot/grub/grub.cfg
Congratulations! ARCH Linux is installed and configured for your box. The last steps needed now is to exit chroot environment, unmount your partitions and reboot system.
# exit # exit # umount /mnt/home # umount /mnt # reboot
25. After the system reboots you will lose network connection and your Network Interface Card name will change. To manage this issue, login with newly created user with sudo powers and issue the following command to get NIC Ethernet name.
# ip link
26. After you get the name of the Ethernet connection start and enable the connection on Ethernet NIC running the following commands.
# sudo systemctl enable firstname.lastname@example.org # sudo systemctl start email@example.com
If you have multiple network interfaces on DHCP run the following command and verify connectivity issuing a ping command against google domain.
# sudo systemctl enable dhcpcd.service
Now your system contains a minimal basic installation that is fully functional to receive and install new software packages, but for now runs only on Command Line with no Graphical User Interface.
Due to its high-portability, rolling release circle, compiling source packages, fine granular control over software and processing speed Arch Linux resembles in many ways with Gentoo Linux but cannot rise to that complex architectural design.