Labels

Sunday, June 7, 2015

Use Arch Linux

Why Arch Linux?


Arch Linux is all about freedom. It is like you build your own house. You choose your land, and you start building your own. Explains Arch philosophy, "KISS" stands for "Keep It Simple Stupid". Just use it once, I'm sure you won't leave it. I'll sort out my points here,

1. Simplicity and performance.
This is the major goal of Arch Linux. Since you build everything from the scratch, you can choose the best components for your needs which give the best desktop experience and simpleness. The lightweight core structure gives the best performance by lower system resource demands.

2. Packages.
Arch Linux has the biggest software repository. I still couldn't find any package that is available for any other distribution but Arch. AUR(Arch User Repository) almost has everything. Arch developers don't patch software that much. Because of that you always get the vanilla packages which are fresh, clean and almost up to date.

3. Package manager.
Arch Linux has a nice package manager, "pacman" for its official repositories, which makes much more easier package management than other distributions. In Ubuntu or other distributions if you are installing some software you have to follow these steps add the repository, update the package list cache and install it. But Arch AUR gives you the ability to do all those stuff in one command. Very easy to maintain packages.

4. Rolling release.
Arch Linux is just the GNU/Linux kernel itself plus the desktop environment. Once you installed Arch Linux you don't have to worry about updating your operating system to newer releases like other distributions, which gives you the ability to use the packages you installed, forever. With Arch Linux, you are always running the latest. You are on the edge.

5. Documentation and community.
Arch Linux is a community driven distribution. It's by the community, to the community. No one can affect its development, nothing commercial. It's all about the freedom. If you are attempting put your hands on Arch Linux, Wiki has a nice documentation. Almost everything is there. This documentation helps you to learn about GNU/Linux much better than all other documentations, all from the scratch.


A simple guide to install Arch Linux.


Step 1 - Make a bootable.
Download Arch Linux image from here and make a bootable drive or a disk using a suitable tool like YUMI or Universal-USB-Installer something like that. If you are using Linux use "dd" to make a bootable.

Step 2 - Boot.
Boot the Arch bootable media you created. Select the appropriate option from the boot menu, whether your system is 64 bit or 32 bit. After booting the installation media, what you get is a root shell.



Step 3 - Set up the network.
Arch Linux installation need a working internet connection to download and install packages. Check whether the network is working,

# ping -c3 www.google.com

If you get an error like "unknown host", you have to setup network manually. If you are using a wifi connection use,

# wifi-menu

Step 4 - Setup partitions.

# lsblk -l //get a list of drives
# cfdisk /dev/sdx //disk utility to configure partitions

In this case, I'm going to make the root partition and swap partition only. If your PC is UEFI possessed, you might need to make a boot partition too. See Arch Linux guide for more details.


Now set the file system types and format partitions. Replace x, a, b and c with appropriate drive letters and numbers.

# mkfs.ext4 /dev/sdxa
# mkswap /dev/sdxb

Step 5 - Mount the partitions.
Now you have to mount the partitions you created.

# mkdir -p /mnt
# mount /dev/sdxa /mnt
# mkdir -p /mnt/home

If you have a boot partition,

# mkdir -p /mnt/boot
# mount /dev/sdxc /mnt/boot

Set swap,

# swapon /dev/sdxb

Step 6 - Install Arch base system and configure file system table.
Now you can install Arch Linux core packages to your drive. If you are encountering problems with this step, try prioritizing mirrors in /etc/pacman.d/mirrorlist file. 

# pacstrap -i /mnt base

And generate the file system table for the system to decide how to use partitions and drives.

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


Step 7 - Configuring system.

# arch-chroot /mnt

To add locale and language support,

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

or manually edit the file /etc/locale.gen.

# nano /etc/locale.gen

Set timezone,

# ls /usr/share/zoneinfo //to get a list of available time zones
# ls /usr/share/zoneinfo/Asia //to get a list of sub zones
# ln -s /usr/share/zoneinfo/Asia/Colombo /etc/localtime
# hwclock --systohc --utc //sync the clock with chosen settings


Step 8 - Configure network.
To use a wired connection, you have to enable the dhcpcd service,

# systemctl enable dhcpcd

For wireless connections install these packages,

# pacman -S wireless_tools wpa_supplicant wpa_actiond dialog

Step 9 - Configure package manager.
Add multilib repository support, which has 32-bit applications in case if you want,

# nano /etc/pacman.conf

Uncomment,

[multilib]
Include=/etc/pacman.d/mirrorlist

Update the system,

# pacman -Syu


Step 10 - Root and users.
Now you have to create a user. For more information, see Arch Linux guide to users and groups.
To set root password,

# passwd //set password

To create a new user,

# useradd -m -g users -G wheel,storage,power -s /bin/bash lahiru
# passwd lahiru //set user password

Set up user privileges, for later sudo accesses,

# pacman -S sudo
# EDITOR=nano visudo

and uncomment,

%wheel ALL=(ALL) ALL


Step 11 - Install some required packages.
Install display server and other packages related including sound. Choose the appropriate video driver when installing this,

# pacman -S xorg alsa-utils 

Step 12 - Install bootloader
Now we are almost done.Install a suitable bootloader like grub or syslinux,
Here I'm going to install syslinux,

# pacman -S syslinux gptfdisk mtools
# syslinux-install_update -i -a -m

See whether if the drive letters are correct in /mnt/boot/syslinux/syslinux.cfg, else manually edit them.

# nano /boot/systlinux/syslinux.cfg


Step 13 - Reboot
Exit from chroot, unmount drives and reboot.

# exit
# umount /dev/sdxa
# umount /dev/sdxb
# reboot

Step 14 - Boot and log in.
Now you can boot and login to your system.



Step 15 - Install a desktop environment.
Now you can install any window manager or desktop environment you like. There are plenty of window managers and desktop environments for Arch Linux. Almost every desktop environment you see in other distributions is there. Let's try installing KDE-5.

# pacman -S plasma kmix

Configure network manager and add USB modem support if you want,

# pacman -S usb_modeswitch modemmanger mobile-broadband-provider-info
# systemctl enable NetworkManager
# systemctl enable ModemManager

Step 16 - Set up a login manager.
It is better if you install a suitable display manager for the desktop environment you installed. There are plenty of display managers around. LXDM is a lightweight one. To install LXDM and enable it on system startup,

# pacman -S lxdm
# systemctl enable lxdm

Step 17 - Change system name.
To change the system hostname use,

# hostnamectl set-hostname --static archlinux

Step 18 - Reboot.
Reboot your system and enjoy. Configure it as you want.

No comments:

Post a Comment