Boot using arch ISO live cd or usb
if you want to install from USB then follow as below
1. download latest arch as ISO
2. if you are using windows then download usbwriter
if you are using linux then use dd
dd if=image.iso of=/dev/sdb bs=4M
Boot using installation media i.e USB
Select x86_64 if you want 64 bit installed (preferred) otherwise select i686 for 32 bit version and press enter
After booting you will see following
use fdisk to see available disks, in above you can see I have 60GB hard drive as /dev/sda
If you are setting up your system first time, you need to create partitions. If partitions already created then you will need to adjust them.
It is recommended to use three partitions for linux. One for root or linux system and second for swap and third for user space i.e home directory.
You can delete a partition and then create 3 partitions from it, if you have partitions already created or you can select existing partitions to install.
I am going with cfdisk to create MBR style partitions on an empty disk. If you need GPT style partitions then you can use cgdisk.
Type cfdisk and select dos
Create a new partition for root (containing your linux OS)
Select New and hit enter
Enter root partition size. 10 GB is enough. If you want to install lots of software then increase as you want. I am intended to use Linux as my primary OS so I am gonna make it 27G.
Select Primary on next screen
Hit enter and select newly created partition. It has created /dev/sda1 as root partition for me, select Bootable from menu and hit enter to make root partition bootable.
Creating Swap Partition (Swap helps great in performance if you don’t have large ram or installing it in VM)
Select new and hit enter to create a new partition for swap
Set swap partition size. 2GB is enough. If you have low ram and heavy load then you can select 3 or 4G. I want 3GB so I selected 3G.
Mark your swap partition as primary and hit enter.
Create extended partitions
We are all set with root and swap partitions. Now we are going to create a home partition where linux will store all user data and config files as well as I will store my documents, music, files, downloads etc. I will mark remaining diskspace as extended to create further partitions as extended instead of primary.
Hit new to create extended partitions
I want to have 30GB size for extended partitions so I write 30G and hit enter, you can give the desired partitions size and hit enter.
Extended is best way to group your partitions so you can shrink or extend later with other partitions.
Extended just marks the next partitions as extended instead of primary, so now we create actual home partition inside extended area.
If you want a primary partition instead then you don’t need to create an extended partition, rather directly create primary partition.
Create Home partition inside the extended partitions group
Select Free space and New and hit enter to create new partition as home.
I want whole remaining space as home partition, you can give the desired size if you want to have more than one partitions like one partition for home and other for data and other for music. To create multiple partitions repeat above steps.
Hit enter and it will create a new partition as /dev/sda5
Now my all partitions are created, its time to save partition structure to hard disk, select Write and hit enter.
Write yes when it asks for confirmation and hit enter.
After writing partitions structure to hard disk, just quit the cfdisk.
Again type fdisk -l to view your newly created partitions.
Formatting your partitions
Its time to format our partitions so linux can use them.
Formatting root partition.
# mkfs.ext4 /dev/sda1
Formatting home partition
# mkfs.ext4 /dev/sda5
We have formatted partitions, now we are going to setup swap partition.
We have created /dev/sda2 as swap partition of 3GB, so we are now marking that partition as swap so linux would be able to use that as swap area.
# mkswap /dev/sda2 # swapon /dev/sda2
Mounting your partitions
Linux can use only those partitions which are mounted. So we need to mount our partitions specifically.
Mount root partition.
# mount /dev/sda1 /mnt
Mount home partition.
# mkdir /mnt/home # mount /dev/sda5 /mnt/home
Hard disk all setup, now forward to install linux.
Select a mirror list:
During installation linux will download files from internet, it is recommended that you select nearest mirror to get fast downloads
# nano /etc/pacman.d/mirrorlist
find your country or nearest one in file by pressing ctrl+w and type your country name and hit enter
copy whole line using alt+6 and now go to start by using pageup button or home button on keyboard
paste that line on the top of file using ctrl+u
now save the file using ctrl+x and enter y to save
Testing your internet connection
Test your internet connection by pinging the google.com
# ping -c 3 www.google.com
Installing base arch linux
# pacstrap -i /mnt base
if you want to build packages then you should need
# pacstrap -i /mnt base base-devel
Hit Enter and it will show the screen below
Hit enter and it will start downloading and installing.
Generate an fstab
linux needs to store partitions and mount information for future use to auto mount drives
lets generate that configuration file
# genfstab -U -p /mnt >> /mnt/etc/fstab
to make sure file has been create correctly please use following
# nano /mnt/etc/fstab
Enter to new arch linux environment
# arch-chroot /mnt
Set your locale
edit locales file
# nano /etc/locale.gen
and uncomment your locale
I uncomment en_US.UTF-8 UTF-8 for english
Generate the locale(s) specified in /etc/locale.gen:
Create the /etc/locale.conf file substituting your chosen locale:
# echo LANG=en_US.UTF-8 > /etc/locale.conf
Export substituting your chosen locale:
# export LANG=en_US.UTF-8
Available time zones and subzones can be found in the /usr/share/zoneinfo/Zone/SubZone directories.
To view the available zones, check the directory /usr/share/zoneinfo/:
# ls /usr/share/zoneinfo/
Similarly, you can check the contents of directories belonging to a subzone:
# ls /usr/share/zoneinfo/Asia
Create a symbolic link /etc/localtime to your subzone file /usr/share/zoneinfo/Zone/SubZone using this command:
# ln -s /usr/share/zoneinfo/Zone/SubZone /etc/localtime
# ln -s /usr/share/zoneinfo/Asia/Karachi /etc/localtime
Set the hardware clock mode uniformly between your operating systems. Otherwise, they may overwrite the hardware clock and cause time shifts.
# hwclock --systohc --utc
Set the hostname of your computer (e.g. arch):
# echo arch > /etc/hostname
Configure your net work
If you prefer wifi:
# pacman -S iw wpa_supplicant dialog wpa_actiond # wifi-menu # systemctl enable netctl-auto@interface_name.service
If you prefer lan then do following
# systemctl enable dhcpcd@interface_name.service example: # systemctl enable email@example.com
To find your interface name you can use either
# ip link or # ls /sys/class/net
You will see your device name as some thing like “enp0s3”
Note: In vm you might not be able to see the wireless as VM provides you network connectivity using your ethernet.
Finishing base installation
Set the root password with:
Now it’s time to create a user for the system and also add some groups to it.
So run the following command and replace ‘tofeeq‘ with your user-name.
# useradd -m -g users -G wheel,storage,power -s /bin/bash tofeeq
add a password to tofeeq
# passwd tofeeq
Once that is done, we will now allow the users in wheel group to be able to performance administrative tasks with sudo. Run the following command to edit the sudoers:
# EDITOR=nano visudo
It will open the sudoers file where you have to uncomment this line:
%wheel ALL=(ALL) ALL
I will also recommend installing bash-completion so that Arch auto-complete commands of names of packages:
# pacman -S bash-completion
Install boot loader
Install the grub package and then run grub-install to install the bootloader:
# pacman -S grub
# grub-install --target=i386-pc --recheck /dev/sda # pacman -S os-prober
# grub-mkconfig -o /boot/grub/grub.cfg
Basic Installation finished, Reboot
# exit # reboot
After rebooting it will get you following screen.
Provide login username and password and switch to root mode for further installations.
Installing display managers
# pacman -S xorg xorg-server xorg-server-utils xorg-xinit
Now we will also install mesa for 3D support:
# pacman -S mesa
It’s time to install video drivers. I am using intel graphic card so would be using
# sudo pacman -S xf86-video-intel intel-dri
If you are not using intel then you might explore
If you are using a laptop you need to install the drivers for input devices like touch-pad
# pacman -S xf86-input-synaptics
# pacman -S xorg-twm xorg-xclock xterm
You can install all at once using following
# pacman -S xorg xorg-server xorg-server-utils xorg-xinit mesa xf86-video-intel intel-dri xf86-input-synaptics xorg-twm xorg-xclock xterm
It will ask you to confirm, just hit enter and continue
It will now keep installing
Install Desktop Environment
I choose gnome as my desktop environment, If you want to install any other then follow this link
# sudo pacman -S gnome gnome-extra
Hit enter and continue
Exit to normal user from root
Add gnome to your .xinitrc file
$ nano ~/.xinitrc
press ctrl + x and hit enter.
You will see a graphical interface of arch linux as gnome is running 🙂
To have better audio experience open terminal and switch to sudo by typing sudo -i and install alsa and pulse audio
# pacman -S alsa-utils pulseaudio pavucontrol
That’s it start enjoying wonderful arch linux !!!
Please add your comments to make it even more easier.