My Arch Linux install process

This is a little guide/how-to on MY Arch Linux install process, this is just what I did and by no means a thorough walk through of the it all. My only aim is to simplify the documentation available on the Arch wiki for my use in the future or to help anybody who may find it useful.

First off, burn the latest Arch ISO to a DVD or flash it to a USB stick. I will assume you already know how to do this and get down to it.

I try to follow the Beginners Guide from the wiki however I partition my hard drive first using gparted from either a Live CD/USB or from an operating systems Live CD/DVD/USB BEFORE starting the Arch install.

Change the language

By default the keyboard layout is set to US. If you have a non-US keyboard layout then simply run:

# loadkeys uk

Next you should change the font :

# setfont Lat2-Terminus16

To change the language edit the locale file and delete the “#” before the language of choice, choose the UTF-8 entry :

# nano /etc/locale.gen
en_US.UTF-8 UTF-8
en_GB.UTF-8 UTF-8

CTRL+X to exit Y to save and then hit ENTER, then run these commands :

# locale-gen
# export LANG=en_GB.UTF-8

Establish an internet connection

Try to ping a server to see if a connection was established. E.G googles webservers:

# ping -c 3 www.google.com
PING www.l.google.com (74.125.132.105) 56(84) bytes of data.
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=1 ttl=50 time=17.0 ms
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=2 ttl=50 time=18.2 ms
64 bytes from wb-in-f105.1e100.net (74.125.132.105): icmp_req=3 ttl=50 time=16.6 ms
--- www.l.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 16.660/17.320/18.254/0.678 ms

If you get a ping: unknown host error, first check to make sure the cable is inserted correctly both in your PC and your modem/router, if not head over to the Arch wiki and check the Beginners guide “Establish an internet connection” section.

Create filesystem

NOTE : I partitioned my hard drive before starting the install process, i kept it easy with only 2 partitions; 1 = somewhere to install the OS and any documents/files, 2 = a swap partition, this is optional. I chose this simple layout as i tried installing Arch a few times before being successful and wasn’t sure if it was problems with my partition table/mounting or problems with the bootloader (tried GRUB many times and failed, when i tried syslinux it worked straight away).

Partitioning your hard drive isn’t enough, the partitions need a filesystem too. I formatted my partitions to ext4 and swap respectively.

WARNING : Double check and triple check that it is actually /dev/sda1 and /dev/sda2 that you want to format. You can use lsblk to help with this.

# mkfs.ext4 /dev/sda1
# mkswap /dev/sda2
# swapon /dev/sda2
 

Mount the partitions

To display your current partition layout simply run :

# lsblk /dev/sda

NOTE : Do not mount more than one partition to the same directory. And pay attention, because the mounting order is important.

We mount the root partition on /mnt just run :

# mount /dev/sda1 /mnt

Select a mirror

Before installing, you need to edit the mirrorlist file and place your preferred mirror(s) first.

# nano /etc/pacman.d/mirrorlist
##
## Arch Linux repository mirrorlist
## Sorted by mirror score from mirror status page
## Generated on 2012-MM-DD
##Server = http://mirror.example.xyz/archlinux/$repo/os/$arch
...

  • Alt+6 to copy a Server line.
  • PageUp key to scroll up.
  • Ctrl+U to paste it at the top of the list.
  • Ctrl+X to exit, and when prompted to save changes, press Y and Enter to use the same filename.

NOTE : Whenever in the future you change your list of mirrors, always remember to force pacman to refresh all package lists with pacman -Syy. This is considered to be good practice and will avoid possible headaches.

Install the base system

The base system is installed using the pacstrap script. this gives you just a base system, the rest can be installed later using pacman.

# pacstrap /mnt base

Generate an fstab

Generate an fstab file by running following command :

# genfstab -U -p /mnt >> /mnt/etc/fstab
# nano /mnt/etc/fstab

Chroot and configure the base system

Now we are going to chroot into the freshly installed base system

# arch-chroot /mnt /bin/bash

Locale

There are two files that need editing : locale.gen and locale.confChoose the UTF-8 encoding.

# nano /etc/locale.gen
en_US.UTF-8 UTF-8
en_GB.UTF-8 UTF-8

# locale-gen
# echo LANG=en_GB.UTF-8 > /etc/locale.conf
# export LANG=en_GB.UTF-8

Console font and keymap

We need to reload the keymap/fonts we set earlier as things have changed.

# loadkeys uk
# setfont Lat2-Terminus16
# nano /etc/vconsole.conf
KEYMAP=uk
FONT=Lat2-Terminus16

Time zone

Now we set the time zone

# ln -s /usr/share/zoneinfo/Europe/Minsk /etc/localtime

Hardware clock

Set the hardware clock mode uniformly between your operating systems.

NOTE: Using UTC for the hardware clock does not mean that software will display time in UTC.

# hwclock --systohc --utc

Hostname

Set the hostname to something of your own (E.G. arch) :

# echo myhostname > /etc/hostname

Configure the network

The network needs configuring again for our newly installed system. If more info is needed check the wiki.

# systemctl enable dhcpcd.service

Set the root password

You can set the root password with :

# passwd

Install and configure a bootloader

For my bootlader i chose syslinux (after several attempts with GRUB which all failed and ended up with me at a grub rescue screen). Much more detailed information can be found at the wiki.

# pacman -S syslinux
# syslinux-install_update -i -a -m
# nano /boot/syslinux/syslinux.cfg
...
LABEL arch
        ...
        APPEND root=/dev/sda3 rw
        ...

Unmount the partitions and reboot

First we exit the chroot environment :

# exit

Then unmount your partitions :

# umount -R /mnt
# reboot

User management

We will add a user so we do not have to be logged in as root all the time.

# useradd -m -g users -G wheel -s /bin/bash mic

To set your password, type :

# passwd [username]

Graphical User Interface

# pacman -S xorg-server xorg-server-utils xorg-xinit

Install mesa for 3D support:

# pacman -S mesa

Install a video driver

The Linux kernel includes open-source video drivers and support for hardware accelerated framebuffers. However, userland support is required for OpenGL and 2D acceleration in X11.

If you do not know which video chipset is available on your machine, run:

$ lspci | grep VGA

For a complete list of open-source video drivers, search the package database:

$ pacman -Ss xf86-video | less

The vesa driver is a generic mode-setting driver that will work with almost every GPU, but will not provide any 2D or 3D acceleration. If a better driver cannot be found or fails to load, Xorg will fall back to vesa. To install it:

# pacman -S xf86-video-vesa

In order for video acceleration to work, and often to expose all the modes that the GPU can set, a proper video driver is required.

Test X

TIP : These steps are optional. Test if you are installing Arch Linux for the first time, or if you are installing on new and unfamiliar hardware.

NOTE : If your input devices are not working during this test, install the needed driver from the xorg-drivers group, and try again. For a complete list of available input drivers, invoke a pacman search (press Q to exit):

$ pacman -Ss xf86-input | less

You only need xf86-input-keyboard or xf86-input-mouse if you plan on disabling hot-plugging, otherwise, evdev will act as the input driver (recommended).

Install the default environment:

# pacman -S xorg-twm xorg-xclock xterm

To start the (test) Xorg session, run:

$ startx

A few movable windows should show up, and your mouse should work. Once you are satisfied that X installation was a success, you may exit out of X by issuing the exit command into the prompts until you return to the console.

$ exit

If the screen goes black, you may still attempt to switch to a different virtual console (e.g. Ctrl+Alt+F2), and blindly log in as root. You can do this by typing “root” (press Enter after typing it) and entering the root password (again, press Enter after typing it).

You may also attempt to kill the X server with:

# pkill X

If this does not work, reboot blindly with:

# reboot

We now need to install the display manager and a desktop environment, the display manager is for a graphical login. Simply run (as root) :

# pacman -S gdm cinnamon

To make GDM the default graphical login method for the system, use the packaged systemd service file, gdm.service. Simply run the following command once to bring up GDM on boot:

# systemctl enable gdm.service
# reboot

Once logged in you can install applications/programs from the terminal, here is a nice list to help get you started. If you need any help refer to the Arch wiki and forum as well as our good old friend google.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s