Wednesday, March 2, 2016

How to Install Arch Linux

A step to step clean installation of arch Linux either in a new machine or virtual machine. You can get the ISO image from www.archlinux.org/download/



Boot the image through a boot medium(flash drive or compact disk).
You will received by an Arch Linux boot menu. Select the preferred version, note that the first in the list(x86_64) is the Arch Linux version of the 64 bit the the second selection(i686) is the 32 bit.After loading you'll be presented with a tty1 logged in screen.

Next is the managing/partitioning of the hard drive.
To find out how the hard drive is called, type;
lsblk

Partition the disk type;
cfdisk /dev/sda

sda being the drive to partition. You may receive a selection label type table, select the dos table. You will see the free space available to you.
Click on New then select Primary
Set it as Bootable, now the boot column will be marked with an *

To make changes to the drive select Write, press enter then write in the words 'yes' then enter for the changes to take effect.
Go back by selecting quit.

To see how the disk has been partitioned type
lsblk

You will see a sda1 partitoned under sda
Now to format the disk
mkfs.ext4 /dev/sda1

Next step is to mount the partition the local file system. You type;
mount /dev/sda1 /mnt

Next step is to install arch Linux into that partition. An internet connection is needed for this.
To connect to a WiFi internet access,if you do not have a working Ethernet connection to the wireless by type;
wifi-menu

Wireless devices will be listed, WiFi names are likely to start with 'wl' select a wireless network and type it's password if it requires any.

Test the connection
ping -c 3 www.google.com

Choose a mirror type;
nano /etc/pacman.d/mirrorlist

Through the list of find a mirror near you for better download speed,

Hit Alt+6 to copy a particular mirror, use the 'Page Up' key to got on top and then hit Ctrl+U to paste the line on top, hit Ctrl+x to exit and type Y to save changes

Next install the packages, run; 
pacstrap -i /mnt base base-devel

When prompt with Enter a selection (default=all): hit enter to install all the selection
To proceed with the installation hit enter. (This is the default as pressing Y)

The next step is set up the fstab file which in Linux is the text file that contains all the partitions and hard drives that you need to automatically mount on system boot. Type
genfstab -U /mnt > /mnt/etc/fstab

If you run the below command you will see the data has been written;
cat /mnt/etc/fstab

Change over from running on the Arch live CD into partition that was just installed into.
arch-chroot /mnt /bin/bash

Next install the boot loader;
pacman -S grub

Configure the downloaded grub
grub-install /dev/sda

NOTE: Install it to the drive but not the partition

Next is to configure the init file system;
mkinitcpio -p linux

Next configure grub again;
grub-mkconfig -o /boot/grub/grub.cfg

You have successfully installed a bootable Linux environment, next step is to install tools for a usable desktop environment;
pacman -S vim

Another important tool is the bash-completion to auto-complete commands;
pacman -S bash-completion

Install the gnome desktop environment or any of your favourable Linux desktop environment;
pacman -S gnome gnome-extra

Set up the locale, this specifies the regional and language stuff of the system;
nano /etc/locale.gen

Using the arrow keys select your locale configuration by uncommenting (removing the # character)
The default and most common locale is en_US.UTF-8 UTF-8 ( English Speakers)
Hit Ctrl+ O then enter
To leave the screen hit Ctrl+X
To update the system to use the locale, type;
locale-gen

To specify English or another language to be used type;
nano /etc/locale.conf

Then type; 
LANG=en_US.UTF-8

Hit Ctrl+ O then enter. To leave the screen hit Ctrl+X to exit nano

The next thing is to set the time zone (continent,Your Country's capital city)
ln -s /usr/share/zoneinfo/Africa/Nairobi /etc/localtime

For a person in New York
ln -s /usr/share/zoneinfo/America/New_York /etc/localtime

Set up the hardware clock on the machine to track the time correctly
hwclock --systohc --utc

Setting the custom hostname for your system, run;echo qwerty > /etc/hostname (replace qwerty with your hostname)

Setting up the root user password. Run;
passwd

enter the new UNIX password then retype it to verify it.

Next step is creating the users and replace 'qwerty' with your username run;
useradd -m -G wheel,storage,power -s /bin/bash qwerty

Give the password for the new user in my case was qwerty;
passwd qwerty

To allow this user to do administrative jobs as sudo, install sudo;
pacman -S sudo


Allow the users in wheel group to be able to perform admin tasks with sudo, to edit that run; 
EDITOR=nano visudo

Move down then uncomment this line in the open sudoers line 
%wheel ALL=(ALL) ALL

Then type :wq to write and quit

Unmount and reboot the machine
exit
unmount
u mount /mnt
shutdown -r now


Remove the existing media (flash drive or cd). You will brought to a login screen. Input your username and password, you need to enable the gdm (gnome desktop manager) service for gnome desktop and then restart the box:
sudo systemctl enable gdm

After login, it is advisable to keep your system up-to-date
sudo pacman -Syu

If their are error messages it's because the network devices have been set, type;
sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager


Then try re-running the previous command to update your packages


There you have it, a working Arch Linux Distro.


[root@e13olf]# exit

3 comments:

  1. This is truly a well-informed post Thanks for sharing with us. If there is anybody who has any queries about Gmail then Contact with Gmail expert link is given below.
    Gmail Contact Number UK

    ReplyDelete
  2. Hi Thank you for sharing this wonderful article. Do well to visit Latest School News to apply for Jamb Registration Form. You can always check your Jamb Result and Neco Result Checker here.
    Do well to check your Admission Status using Jamb Caps. Check Best University that offer Medicine and Surgery

    ReplyDelete