LINUX

How I Installed Arch Linux


After getting used to Linux distros with batteries included (i.e., Fedora, OpenSUSE, Ubuntu, etc.) I decided to try something a bit more challenging even to install. There are a few distros that fit the profile, but I chose Arch Linux as my first DIY-Linux based OS. As described by the Arch Linux developers, "Arch Linux is a versatile, and simple distribution designed to fit the needs of the competent Linux® user. It is both powerful and easy to manage, making it an ideal distro for servers and workstations. Take it in any direction you like." In addition, the development of this distro is alive and kicking on a daily basis. It is one of the few rolling releases, meaning that once you install it, you don't have to go through any brutal upgrade processes. The core, base, kernel and packages are constantly updated, bringing you the most recent features and keeping your system safer from exploits. Consequently, there are thousands of packages that can be installed either from the official repositories or the Arch User Repository (AUR).

Now let's dive into the technical side of installing Arch Linux. Before I proceed, please keep in mind that the following steps of installing Arch Linux are about 3 years old, but they should still get the job done (highly doubt there is any new way of doing this). After following the proper procedures of downloading and setting up your desired bootable media, you are now ready to boot into Arch Linux's Live environment. The boot menu of the LiveCD should be similar to the image below. At the boot menu select the architecture of the machine you are going to install Arch Linux on, which are 32bit (i686/i386) or 64bit (x86_64/AMD64). Once its done booting and you are at the command prompt, following the steps below.



######### Installation Guide: Arch Linux V.2012.10.06 #########

When you are at [root@archiso:~]:

1. Preparing disk:
  • a. cfdisk /dev/sd! #to start gparted 
  • b. At gparted: 
    • -->for boot: [new]->[primary]->[enter size(1gb)]->[bootable] 
    • -->for swap: [new]->[primary]->[enter size(2gb)]->[type]->[82:linux swap] 
    • -->for /root&/home: [new]->[primary]->[enter size(rest)]->[write] 
    • --> answer: yes 
    • --> [quit]
2. Formatting disk:
  • a. -->for swap: mkswap /dev/sda (swap#) 
    • -->for swap paging: swapon /dev/sda (swap-part) 
    • -->to check results: swap -s
  • b. -->for boot: mkfs.ext4 /dev/sda (boot#) 
    • -->for root/home: mkfs.ext4 /dev/sda (root/home#)
3. mount partitions:
  • a. mount last created partition(root/home) 
    • --> mount /dev/sda /mnt (root/home#)
  • b. create a directory for boot partition 
    • --> mkdir /mnt/boot 
    • --> mount /dev/sda /mnt/boot (boot#)
4. network configuration:
  • a. to get internet connection 
    • --> dhcpd 
    • --> check if you have internet connection: ip addr 
    • --> or: ping -c 3 google.com
5. Install base paclages:
  • a. pacstrap /mnt base
6. Install GRUB:
  • a. pacstrap /mnt grub-bios
7. System configuration:
  • a. genfstab -p /mnt >> /mnt/etc/fstab 
    • --> verify results: cat /mnt/etc/fstab
  • b. swap missing device node: 
    • --> vi /mnt/etc/fstab 
    • --> scroll to swap line and add /dev/sda (swap#)
  • c. change root into the system 
    • --> arch-chroot /mnt
  • d. add time zone: 
    • --> ln -sf /usr/share/zone-info/US/Central /etc/localtime
  • e. set locale(language) 
    • --> vi /etc/local.gen 
    • --> uncomment: en_US ISO-8859-1 and en_US.utf-8
  • f. edit locale.conf 
    • --> vi /etc/locale.conf 
    • --> LANG="en_US.utf-8" 
    • --> LC_COLLATE="C"
  • g. generate locale 
    • --> locale-gen
  • h. edit rc.conf 
    • --> vi /etc/rc.conf 
    • --> timezone="US/Central"
    • --> keymap="us"
    • --> locale="en_US.utf-8"
    • --> hostname="archlinux"
    • --> interface="eth0"
  • i. edit resolv.conf 
    • --> vi /etc/resolv.conf 
    • --> nameserver 127.0.1.1
  • j. edit hosts 
    • --> vi /etc/hosts 
    • --> enter the hostname you chose to the far right. For example;
      • 127.0.0.1    localhost 
      • 127.0.1.1    archlinux
  • k. install ram disk file 
    • --> mkinittcpio -p linux
  • l. install bootloader 
    • --> grub mkconfig -o /boot/grub/grub.cfg 
    • --> grub-install /dev/sda
  • m. change root password 
    • --> passwd (enter password twice)
  • n. quit chroot environment
    • --> exit
  • o. unmount all system files you mounted before rebooting 
    • --> umount /mnt/boot 
    • --> umount /mnt
  • p. reboot 
    • --> reboot
#################################################

That's all there is to it. The next step is to configure Arch Linux according to your needs. For instance, using it as a desktop or workstation does not require much configuration as is the case with a production server. Mostly, Arch Linux is used as a workstation and in that case you will need to install a display manager along with a desktop manager. Depending on your hardware capabilities, you may want to use a desktop environment (DE) that comes pre-packaged with all the applications you will need (of course you can install the ones you are comfortable using). The other option is to use a window manager (WM). WMs' are lightweight and designed to only consume a very small amount of RAM.
So from here, you will need to consult the Arch Linux wiki pages for the following needs:
  • System configuration (wireless, webcam, audio, video, servers, etc.)
  • DE and WM choices, installation and configuration steps
  • Other tips, tricks, tweaks and hacks
Arch Linux home page: https://www.archlinux.org/
Arch Linux wiki page: https://wiki.archlinux.org/
Arch Linux download page: https://www.archlinux.org/download/
Arch Linux AUR page: https://aur.archlinux.org/
Arch Linux official repos page: https://www.archlinux.org/packages/

Ars Technica