How to install and configure Arch Linux 

Arch Linux is a CLI-only Linux distribution that is very bare-bones and customisable. Arch can be fairly difficult to install if you are unfamiliar with how to use a CLI or don’t know what packages you need. This guide will show you how to install a minimal Arch Linux installation that will only use 20MB of RAM when it is installed. From this point you will be able to add whatever you like to it, be it a web server, samba server or Bittorrent webUI.

Downloading Arch Linux

Arch can be downloaded from here: http://www.archlinux.org/download/

If you are installing on a 64-bit CPU you might want to download the x86_64 core iso, the i686 core image will still work, but the 64-bit image will support more RAM, so if you have more than 4GB you will need the x86_64 image for all of the RAM to be usable.

About upgrading… Arch Linux has a “rolling release” which means once you’ve installed you can run:

sudo pacman –Syu

to upgrade and you will not have to download any new ISO images or even run dist-upgrade like on Ubuntu.

Using the ISO

When you have downloaded the ISO image you can burn it to a CD with Nero Burning ROM or InfaRecorder. If you don’t have a CD RW drive or a blank CD but you do have a USB stick you can copy the installer to the USB stick with unetbootin or another tool mentioned in the Arch Linux wiki page and boot from that.

Installing

Install the CD or USB stick and boot from it, you will get a GRUB menu that looks like this:

Press enter and give Arch a minute to boot. Once the CD/USB has booted you will be presented with a login prompt like this:

As you can see from the text, type “root” and then enter, this will log you in and give you a BASH shell. From here you type in the prompt:

/arch/setup

You will get this welcome message, press enter and you will be shown this menu:

Press enter to select the source (the medium on which the installation files are kept)

Make sure “cd” is selected and press enter – If you have used a USB stick, you will still need to select cd too.

Press enter at the next prompt and when you are back at the menu press “Set clock”, press enter at the “Select region and timezone” selection and use the up and down arrows on your keyboard to navigate the location list, pressing enter at the appropriate location. For example, if you live in England, Press enter when you select the “Europe” item, and then enter again on the “London” item. Once this is done press “Return to Main Menu” and from there press the “Prepare Hard Drive” item.

If you want to wipe the current drive press enter, if you want to manually manage your partitions select the “Manually Partition Hard Drives” option, but keep in mind that Linux needs one partition for the root filesystem, one partition for swap and an optional partition for the bootloader (GRUB.)

If you select the Auto-Prepare option you will only have to keep pressing enter to the many prompts until you get to the “Filesystem Selection” menu, where you should select “ext4” as the filesystem and press enter until you get back to the main menu again.

Now that you’ve prepared your Hard Drive, press the “Select Packages” Menu entry.

After a few prompts (that I am sure you have read thoroughly)  you will be presented with a selection of two package groups:

If you will need to be doing development or compilation of programs on the install then you may want to select the base-devel option, if not, leave it unchecked and it will save you some space.

Note: To select/deselect an item, press the spacebar whilst hovered over the item. The enter key will as usual advance to the next dialogue.

Next up, you will need to select which packages you want to install by default (with the spacebar, remember?) There are a bunch of packages selected by default, however, if you are wanting to save space you might want to deselect some programs like:

Things you’ll need to select…

Press Enter, select “Install Packages”, enter again and wait for Arch to install.

Once installed, we will move on to the “Configure System” section. When you are given the option, select which editor you wish to use when you’re editing these files. I suggest beginners use the nano editor because it is easier.

The first file that we need to edit is the rc.conf file. Coincidentally, this is the first file in the list, you all you have to do it press enter.

You will need to change the values of some of these entries, if you live in the UK, you will want to make sure that

LOCALE=”en_US.UTF-8”

Is changed to

LOCALE=”en_GB.UTF-8”

The next thing that needs editing is the HOSTNAME entry. The hostname is what your computer will be called, and what the rest of the network will call you. The hostname can be whatever you want it to be (as long as it has no spaces,) find the following…

HOSTNAME=”myhost”

In the rc.conf file and change the ”myhost” portion to whatever you will be calling your computer.

The final thing to change is the DAEMONS entry, this is a list of daemons (services to Windows users) that run when the OS boots, you will need to add “sshd” to the list so that the SSH server runs when the OS boots.

To save the file in nano, simply press ctrl+o to save and then ctrl+x to exit.

And that’s all that needs doing for rc.conf, the next file to edit is hosts.allow, in order for SSHD to be accessible it needs to be unblocked by Arch’s built in firewall. To allow this we need to add:

sshd: ALL: ALLOW

to the hosts.allow file. Once that is done, save and quit.

Next up… /etc/pacman.d/mirrorlist, this file basically tells Arch Linux’s package manage (pacman) where it can get its packages from. Sadly, as this moment in time it doesn’t know where to get its packages from, so we will need to edit the mirrorlist and uncomment some of the lines. It is preferable to uncomment servers that are closest to you so that you can get the best speeds. I tend to use only HTTP mirrors because they are faster.

Save, quit and you’ll once again be faced by the infamous Main Menu. Fortunately, you won’t have to look at its ugly face for much longer as we’re down to our last entry… Root-Password. Select this and type your new password (twice.) I know it looks like you’re not typing anything, but that’s for security reasons, you really are :) Once you’ve set your password, press the down arrow to discover that sneaky “Done” entry and press it.

That will result in the above screen which takes a minute or two to sort out your settings. After it’s finished you will need to install the Bootloader, press the entry, select GRUB, press OK, ctrl+x the GRUB config file and select a hard drive partition to write the bootloader to (/dev/sda is the most common) Once that’s done, Press OK again and then press the “Exit Installer” option.

There you are! All installed. Type reboot in the command line and your brand-spankin’ new Arch Linux installation is ready to be used! Just login with root and the password you set and get your groove on.

Finally, before installing any packages you will need to make sure that everything is up to date by running

pacman -Syu

And if pacman itself gets updated you will need to run this command twice.

SSH

When you’re logged in, type
Ifconfig | grep inet

And the first IP address entry (or the one that isn’t 127.0.0.1) can be used to access the server via SSH.

Published on 12 October, 2010 by Luke Channings

Tags:, ,

Categories: Linux Guides