Install Pure Arch Linux

Finally, I was able to install pure Arch Linux.. I mean not a distribution of Arch. Just pure Arch Linux. So I thought to share it. Note : I first tried this on a Virtual Machine. But it went well, so I tried it on my PC and now it is running Arch.. 🙂

Boot

Download newest Arch Linux ISO file from here. And make a bootable CD/DVD or a USB drive. If you are using a VM, you just need the .iso file. I tried UNetBootin, but it gave me some errors and couldn’t get the USB booted. I’d found  out that it is a problem with UNetBootin.So I used dd command in Linux to copy the ISO file into the USB. Look into this for more info. Then boot the computer (or VM) with the Arch Bootable device. Then you will be prompted to Arch Installation menu. Select the appropriate installation architecture. (In this case, I’ve selected “Boot Arch Linux (x86_64)” since I needed the 64 bit mode.) Now you will be prompted to the Arch installation terminal.

Install

Partitioning

First, you have to partition your hard disk. You may need a separate partition for swap as well. And you even can use separate partitions for root and boot as well. But in here, I only use a  single partition + a swap partition (optional). You can use the cfdisk command to create the partitions. Create a Linux partition for the installation and a swap partition for the swap.

$ cfdisk

If you have many physical disks, you can specify the hard disk as following.

$ cfdisk /dev/sda

Do not forget to make the main Linux partition Bootable. After finalizing the partition table, use write option to write the partition table into the disk. Then quit. Now you have to format the partitions. You can use mkfs command for that. (Please note that we use partition names, not disk names.)

$ mkfs.ext4 /dev/sda1

To create the swap partition. $ mkswap /dev/sda2 Then you have to mount the partitions.

$ mount /dev/sda1 /mnt
$ swapon /dev/sda2

Now you are ready to go.

Install

Before installing, you may need to configure your network settings.

$ ip addr add <ip_address>/<sub_net_mask> dev <device_name>

Example :

$ ip addr add 10.22.40.201/255.255.255.0 dev enp0s25

Define the default gateway.

$ ip route add default via <gateway>

Example :

$ ip route add default via 10.22.40.254

If you need a separate DNS,

Edit /etc/resolv.conf and add,

nameserver 8.8.8.8

Install the base system using,

$ pacstrap /mnt base base-devel

Then generate the fstab file by,

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

Now, change the root to the installation.

$ arch-chroot /mnt

Now this is your Arch Linux installation. We have to create the init ram disk file by,

$ mkinitcpio -p linux

Don’t forget to change the root password.

$ passwd root

Type a new password and confirm it. Then add a normal user for the system by,

$ useradd -m -g users -G wheel -s /bin/bash praneeth

Replace praneeth with any name you want. It will be the user name. Then add a password to that user by,

$ passwd praneeth

Type a new password and confirm it. Now you can add this user to the sudoers list.

$ nano /etc/sudoers

Then look for # user privileges (using Ctrl + W) and after the root entry, add,

praneeth ALL = (ALL) ALL

Then save and exit. (using Ctrl + X) Before you proceed, it is better to upgrade the system by,

$ pacman –Syu

It will install many needed packaged including sudo and grub. Now you can configure the grub by,

$ grub-mkconfig -o /boot/grub/grub.cfg

It will generate the grub configuration file. If you get an error (as I did), you have to edit the default configuration file.

$ nano /etc/default/grub

And add the following line to the end of the file.

GRUB_DISABLE_SUBMENU = y

Now create the grub configuration file again with,

$ grub-mkconfig -o /boot/grub/grub.cfg

It should work. Now install the grub on the hard disk. (Not on the partition.)

$ grub-install /dev/sda

It will create a new boot loader and it may replace any other boot loader, such as Windows boot loader. Then you have to install os-prober in order to detect them and add them to Linux grub. Hence, it is recommended to to do that before generating the grub config. If you already had, just run the above two commands again.

$ pacman -S os-prober

That’s it. Now you are ready. But…. When I installed Arch, I had to face a problem with my wi-fi drivers and my computer did not get booted. So I’ve found a way round for that. You have to install the basic firmware for the wi-fi devices. But it is not in the official repositories. You have to build it from user repositories. For that, you need packer command. But it is also not in the official repositories. So first you have to download packer PKGBUILD file and build it. But still you need few packages to build it.

$ pacman -S wget fakeroot jshon expac git binutils

Then download the packer PKGBUILD file. First cd to your home directory, since you don’t need mess on the root directory.

$ cd /home/praneeth
$ wget https://aur/archlinux.org/packages/pa/packer/PKGBUILD
$ makepkg

Now packer package is built as a .tar.xz file. Then use –U option in pacman to install it.

$ pacman -U /packer-<something.something..>.tar.xz

Now you can install the wi-fi firmware by,

packer -S b43-firmware

Now you are done…!!! exit the chroot, unmount and reboot. (And remove the bootable device)

$ exit
$ umount /dev/sda1
( $ umount /dev/sda2)
$ reboot

More configurations

If you did everything right, now you will be prompted to the Arch Login. Login using the normal user account. First, we’ll change the hostname of the computer.

$ sudo nano /etc/hostname

Then type a desired hostname. You normally should be connected to internet after login. If not, simply enable DHCPC service by,

$ sudo pacman -S dhcp
$ sudo systemctl enable dhcpcd
$ sudo systemctl start dhcpcd

Then enable locales by editing and uncommenting the needed locales.

$ sudo nano /etc/locale.gen

I uncommented en_US.UTF-8 UTF-8, en_US ISO-8859-1 and si_LK UTF-8. Then we can apply these changes by running,

$ sudo locale-gen

Install a desktop environment.

To get on with Arch Linux, it is better to use a desktop environment. I’m going to install LXDE here. (I tried XFCE4, but it was not working properly with new Arch versions.)

$ sudo pacman -S xorg xterm xorg-clock xorg-twm xorg-xinit xorg-server-utils mesa lxde lxdm

After installing, enable LXDM by,

$ sudo systemctl enable lxdm

You can restart or start LXDM straight away by,

$ sudo systemctl start lxdm

Everything should work smoothly now.

Cheers..!! You have successfully installed Arch Linux on your computer..

03 comments on “Install Pure Arch Linux

Leave a Reply