Installing Arch Linux using the official ISO

Exclusive offer: get 50% off this eBook here
Arch Linux Environment Setup How-to [Instant]

Arch Linux Environment Setup How-to [Instant] — Save 50%

Get started with Arch Linux as a blank canvas and build the simple and elegant environment you want with this book and ebook.

A$9.99    A$5.00
by Ike Devolder | February 2013 | Linux Servers Open Source

Arch Linux is a very flexible distribution and this article by Ike Devolder, author of Arch Linux Environment Setup How-to 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.

(For more resources related to this topic, see here.)

Getting ready

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:

  • Preparing, booting, and setting keyboard layout: We are going to get the ISO file from the download page of the Arch Linux website and store it on the preferred media of our choice. At the time of writing this article, there is a dual ISO image file that contains both i686 and x86-64 architectures on one disk. Start your PC with your preferred installation media (CD or USB stick). On most PC systems, you can access the boot menu by pressing one of the function keys, usually between F8 and F12 depending on the motherboard manufacturer. On older machines where you do not yet have a boot menu, you might need to change the boot order in the BIOS where the CD-ROM (or DVD/Blu-ray) has to be chosen as the first device to try booting from. We'll also explain how to use a different keyboard layout than the default one in this recipe.

  • Creating, formatting, and mounting partitions: You can partition the disks the way you want using cfdisk (for MBR disk partitioning) or cgdisk (for GUID disk partitioning). After creating the partitions, we can choose to format our created partitions with specific filesystems. When all partitions are formatted, we need to mount the partitions. First we will mount the root partition to /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.

  • Connecting to the Internet: To be able to continue installing the ISO you need to connect to the Internet, because there are no packages available for installation on the ISO. For a wireless network you will need to use netcfg. When connected to a wired network, just use dhcpcd or dhclient.

  • Installing the base system and boot loader: These days the base system gets installed by running a simple script pacstrap. Pacstrap takes multiple parameters, the target location, and the packages or groups you want to install. For people who want to develop on their machines, the best base install is adding base-devel to the default installation. For normal end users, just base will be sufficient to start.

  • Configuring the system: In this recipe, we'll describe the flow of what to do during the configuration.

How to do it...

The following steps will guide you in preparing, booting, and setting keyboard layout:

  1. Once you have downloaded the ISO image file, you should also verify its integrity by downloading the sha1sums.txt file from the download page.

    These days you can also check if the ISO is completely valid by verifying the signature of the ISO.

  2. Verify the integrity by issuing the 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:

  3. As you can see in the previous screenshot, the ISO's checksum is ok and the signature is valid.

  4. Now that we are sure our ISO is ok, we can burn this to a CD with our favorite burning program.

  5. Insert the CD into the drive, or insert the USB stick into the USB port of your PC.

  6. Enter the boot menu, or let your computer automatically boot from the inserted installation media.

  7. If the previous steps are performed correctly, you will see the following screenshot:

  8. Select the architecture you want and press Enter, and we'll be on our way.

  9. Search the keyboard layout desired for your region. The available keyboard layouts can be found at /usr/share/kbd/keymaps/.

  10. Set the desired keyboard layout with loadkeys keyboardlayout.

Now let's perform the following steps to create, format, and mount partitions:

  1. Start cfdisk or cgdisk, having the first parameter as the device you want to partition:

    cfdisk /dev/sdX cgdisk /dev/sdX

  2. Create your partition scheme.

  3. Store the partition scheme.

  4. Use the mkfs command to create a filesystem on a specific partition:

    mkfs -t vfat /dev/sdX mkfs.ext4 -L root /dev/sdX

  5. Mount your root partition to /mnt:

    mount /dev/sdX3 /mnt

  6. Make directories under mount for your other partitions:

    mkdir -p /mnt/boot

  7. Mount the other partitions:

    mount /dev/sdX1 /mnt/boot

The following steps are needed to connect to the Internet:

  1. When we need a wireless network, create a netcfg profile and run netcfg mywireless.

  2. Use dhclient or dhcpcd to get an IP address.

The following steps should be performed for installing the base system and boot loader:

  1. Run pacstrap with the desired parameters:

    pacstrap /mnt base base-devel

  2. Install the desired boot loader: the best choice at this moment is Syslinux.

  3. The final installation of the boot loader will be done in a chroot during the initial configuration.

We'll now list the steps to do during the configuration:

  1. Generate fstab with genfstab:

    genfstab -p /mnt >> /mnt/etc/fstab

  2. Change the root into the system location:

    arch-chroot /mnt

  3. Set your hostname in /etc/hostname.

  4. Create /etc/localtime symlink.

  5. Set your locale in /etc/locale.conf.

  6. Uncomment the configured locale in /etc/locale.gen.

  7. Run locale-gen.

  8. Configure /etc/mkinitcpio.conf.

  9. Generate your initial ramdisk:

    mkinitcpio -p linux

  10. Finish installation of your boot loader.

  11. Set the root password with passwd.

  12. Leave the chroot environment (exit).

How it works...

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.

Summary

This article explained the procedure to get Arch Linux installed on your system using the official installation media.

Resources for Article :


Further resources on this subject:


Arch Linux Environment Setup How-to [Instant] Get started with Arch Linux as a blank canvas and build the simple and elegant environment you want with this book and ebook.
Published: November 2012
eBook Price: A$9.99
See more
Select your format and quantity:

About the Author :


Ike Devolder

Ike Devolder started playing around with Linux in 1999 and became a full-time Linux user in 2002. At that time his preferred distribution was Slackware, which he used for many years without complaints. In 2005 he rediscovered Arch Linux (he had already played around with it in the past) and started considering switching all his desktops from Slackware to Arch Linux. In 2006 it was done, with his laptop and desktop both running smoothly on Arch Linux, and since then he has gradually stopped being a distrohopper.

These days Ike is a Web Developer for Studio Emma in Belgium. He uses Arch Linux in his day job too.

Books From Packt


 MySQL Admin Cookbook
MySQL Admin Cookbook

 Linux Thin Client Networks Design and Deployment
Linux Thin Client Networks Design and Deployment

 Linux Mint System Administrator’s Beginner's Guide
Linux Mint System Administrator’s Beginner's Guide

Linux Shell Scripting Cookbook
Linux Shell Scripting Cookbook

 Linux Email: Set up and Run a Small Office Email Server
Linux Email: Set up and Run a Small Office Email Server

 BackTrack 5 Cookbook
BackTrack 5 Cookbook

BackTrack 4: Assuring Security by Penetration Testing
BackTrack 4: Assuring Security by Penetration Testing

 Pluggable Authentication Modules: The Definitive Guide to PAM for Linux SysAdmins and C Developers
Pluggable Authentication Modules: The Definitive Guide to PAM for Linux SysAdmins and C Developers


Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software