Guest Author
This blog post intends to encourage intermediate Linux users to take a leap into the unknown world of the Arch Linux system. The first task for joining the Arch world involves installing the operating system. Unlike Windows and simpler Linux installations, the Arch installation provides a unique and rewarding experience in itself.
Download our Linux Commands Cheat Sheet
You get the opportunity to practice commands and understand how the system is structures and works. To embark on this new journey, follow these 29 tweets to construct a fully-functional Arch Linux system on a laptop or desktop.
Before starting: Research your system’s architecture, check for a Legacy or UEFI Bios, and read installation resources.
This blog post serves as an installation guide, but I relied on the Arch Linux Wiki Beginner’s Guide, Lifehacker’s Arch Install Guide, and assistance from a friend who guided me through the installation on my personal laptop six months ago. The extra resources help with hiccups along the way. Pre-installation research should include finding out about your system’s architecture (32 or 64-bit), if the computer runs on a Legacy or UEFI BIOS, and creating a list of compatible programs for Arch after finishing the installation. Also, before attempting the full installation, it’s a good idea to test it out on VirtualBox.
1. Download the Arch Linux ISO image and burn it to bootable USB or CD.
This step seems simple enough. Lucky for me, I found a CD with an Arch image from months back in a Linux+ class. If you choose the USB option, this command statement pushes the ISO image to the bootable USB: dd bs=4M if=ubuntu-12.04.2-server-i386.iso of=/dev/sdb
2. Access the boot menu after powering up and select your USB or CD.
Enter the boot menu when powering up the machine. The keyboard options for accessing the boot menu differ for each device. For example, F10 or F12 accesses the BIOS on my Lenovo laptop.
3. Choose the right Arch linux ISO for your system. I used x86_64 since my Lenovo has 64-bit architecture.
Before burning the ISO image to a bootable storage device, see what your system architecture requires. At the official Arch Linux download page, I downloaded a dual ISO image to simplify the decision. After booting the right kernel, you should find yourself at root. If you experience blank screen issues, refer to the Arch Linux Wiki for assistance.
4. Went with cfdisk to partition hard drive. Created one main bootable partition and one for swap Arch linux
The tool cfdisk allows you to view the partition table and write/delete partitions. I created one main bootable partition and one for swap. This step depends on your specific needs. For example, you may want to dual boot with a Windows system or create several partitions.
5. Create a file system and swap on the right partitions with command-line statements “mkfs.ext4 /dev/sda1” and “mkswap /dev/sda2” linux
The “mkfs” stands for make file system. I opted for an ext4 or Fourth Extended Filesystem. For additional options, read up at the Arch wiki file system page. Write the file system to the correct partition and the same rule applies for swap.
6. Mount the main partition to /mnt with “mount /dev/sda1 /mnt” Arch linux
I mounted the main partition to /mnt with this line “mount /dev/sda1 /mnt” and then mounted the home directory with “mount /dev/sda1 /mnt/home”. Before moving on, it’s a great idea to edit the official mirrorlist for downloading packages and updates from preferable and closer locations.
7. Make the home directory with “mkdir /mnt/home” and then mount it with “mount /dev/sda1 /mnt/home”. After turn “swapon”
Stick with the “mkdir” command and write it to the appropriate partition. Make the home directory before mounting it to /mnt as I mentioned in the previous step.
8. Edit the pacman mirror list with vi or nano text editors “vi /etc/pacman.d/mirrorlist”
Vi and nano are both effective for this task. I used vi and the entered the statement “vi /etc/pacman.d/mirrorlist” for editing the list. The question you may have is; How should I edit the list? You can adjust the list order to ensure pacman (Arch’s package manager) pulls from those sources first before the others. You could go as far as deleting mirror locations all-together.
An easy way to approach this step is to uncomment the lines of the mirrors you prefer. Read about mirrors here if you want additional insight.
For me, I chose the the closer US, Canadian and UK mirror locations.
9. Install the base system with “pacstrap -i /mnt base”
This command statement installs the base Arch system.
10. Create a file system tab with “genfstab -U -p /mnt >> /mnt/etc/fstab”
The file system table holds the partitions and drives for your system.
11. Change to the /mnt directory with “arch-root /mnt”
This step is required since you mounted the file system and home directories to /mnt directory. Afterwards it’s good to perform a few basic configurations such as setting the local time and date, adding users and passwords.
12. Edit locale.gen file with “nano /etc/locale.gen” to set local settings. I uncommented the en_US lines for United States.
I uncommented the “en_US” lines to go by time and dates in the United States. Find the lines for your location.
By this step if you are unsure about what I mean when saying to uncomment a line, a comment refers to the # sign. In text files the comment sign tells the computer to ignore the text in the corresponding line.
13. Generate the local date and time with “locale-gen” command
The command generates the local time and date info from the locale.gen file.
14. Set the system to my local time zone with “ln -s /usr/share/zoneinfo/America/New_York /etc/localtime”
Substitue your country and local region in the “America” and “New_York” sections above in the statement.
15. Set the clock with “hwclock —systohc –utc”
The statement sets the clock to Universal Time Coordinated. After installing and accessing a GUI later, you can adjust the change the clock to a 12 or 24 hour clock.
16. Set up ethernet connection by enabling dhcpcd with “systemctl enable dhcpcd”
Dhcpcd is an open source dhcp client that gathers info such as netmasks, IP and broadcast addresses from the dhcp server to configure the network interfaces for the host system. The systemctl command is the command for systemd to enable and start dhcpcd. Systemd manages system services.
17. Edit pacman’s configuration file and uncomment the core, extra, community, and multilib repositories with “nano /etc/pacman.conf”
The pacman.conf configuration file for the pacman, Arch’s package manager, lists the repositories where it goes for package updates.
As you can see in the image above, I uncommented “multilib” to include the mirrorlist edited earlier.
18. Update the pacman repositories list with “pacman -Sy”
The -Sy option of pacman calls for a system update.
19. Add a root password with “passwd” command
The passwd enables you to set a password for root and however many users added to the system.
20. Add a user with “useradd -m -g users -G wheel,storage,power -s /bin/bash name” and then user password with “name passwd”
This statement adds a user and sets specific user permissions. Combine new usernames after with the passwd command to create separate user passwords.
21. Edit the sudoers file at “EDITOR=nano visudo” and uncomment “% wheel ALL=(ALL) ALL)” to give sudo access to the user
The sudoers file includes permissions for users who can and cannot have sudo or root access without being root.
Uncommenting line “% wheel ALL=(ALL) ALL” enables the users added with sudo access to download new packages and perform additional functions from the command-line.
22. Install a boot loader such as Grub or Syslinux. I chose syslinux and installed it with “pacman -S syslinux”
The process involved with installing a boot loader isn’t as simple as it seems. For an extended look at the additional steps for each boot loader, visit the Arch Linux instructions for Syslinux and Grub.
23. Edit the Grub or Syslinux configuration files to ensure they boot to the correct partition
Don’t make the same mistake I did by ignoring this step and failing to realize why the new system wouldn’t boot. Visit each file to make the Grub or Syslinux boot to the right partition. In my case, Syslinux boots to sda1.
24. Exit /mnt. Unmount the partitions and reboot with: “umount /mnt/home” “umount /mnt” and “reboot”
After leaving the /mnt directory, unmounting everything mounted before and rebooting, you can remove the installation CD or USB.
25. After reboot and logging into the new system, make sound work by installing “pacman -S alsa-utils”
The advanced Linux sound architecture (ALSA) gives the system sound. The alsa-utils package includes utilities with asla for enabling system sound to function. After installing the package, you can test the speakers with the alsamixer command.
26. Install x window system with “sudo pacman -S xorg-server xorg-xinit xorg-server-utils” and “pacman -S xorg-twm xorg-xclock xterm”
The X Window System provides a graphical framework for a Graphical User Interface (GUI).
Test out x with “startx”. All works, then exit and let’s move on to the desktop environment.
Typing exit in the display window exits out of X window. If you haven’t done so already, visit the desktop environment Arch Wiki page to see the full list of compatible desktop environments.
27. Install the desktop environment (GUI) with “pacman -S”. I chose cinnamon for the time being.
Arch Linux is a lean text-based operating system. The structure of the OS allows the user to customize the system completely, including the GUI or desktop environment. If you’re similar to me, your indecision will force you to install two to three GUIs for trial runs. In this installation, I decided on Cinnamon and Enlightenment.
28. Install, enable the correct display manger for your GUI. I chose cinnamon which is based on Gnome. I needed to install gdm
Without the display manager installed and enabled, the GUI will not run properly. As mentioned before, minimal research in the Arch Wiki suffices for seeing which display manager supports desktop environments.
Mixing and matching between Gnome and KDE variants may cause problems for logging into separate GUIs on the same system. Gnome uses gdm and KDE relies on kdm. Keep this in mind if you test out more than one environment.
Install gdm with “pacman -S gdm” and enable with “systemctl enable gdm”
Use systemd to enable the correct display manager services to run at start up.
29. Reboot and login to your new Arch Linux system
Remember the list about compatible programs you made before starting? Find the correct package names on the Arch wiki and installing the programs. In the next post, I will go through a list of compatible applications for your new system.
I first began my relationship with Arch back taking a Linux+ class. The installation process provides an excellent opportunity for teaching and learning.
The Linux Commands Reference Sheet will definitely become useful when installing Arch Linux.