Arch Linux / Linux / windows / wine · September 1, 2014 9

Arch Linux an easy install with windows (dual boot) for beginners

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
http://sourceforge.net/p/usbwriter/wiki/Documentation/

 if you are using linux then use dd

dd if=image.iso of=/dev/sdb bs=4M

After boot go as follow

Partitioning:

if you want windows as dual boot then you should use fdisk or cfdisk (it creates MBR supported by windows as GPT is not supported by windows)

if you just want only linux then use cgdisk (it creates GPT tables)

I have windows 7 as dual boot so i go with cfdisk

create root and home partition if don’t have already

I have created two partitions here /dev/sda2 for root and /dev/sda3 for home

Formating partitions (creating file system)

# mkfs.ext4 /dev/sda2
# mkfs.ext4 /dev/sda3

It is good idea to create swap drive as well for swap operations and hibernation support

create 2gb of partition i.e /dev/sda4

create swap on /dev/sda4

# mkswap /dev/sda4
# swapon /dev/sda4

Now mount your partitionis

# mount /dev/sda2 /mnt

I am going to create home directory in root and will mount dev/sda3 to it

# mkdir /mnt/home
# mount /dev/sda3 /mnt/home

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

Installing base arch linux

# pacstrap -i /mnt base

if you want to build packages then you should need

# pacstrap -i /mnt base base-devel

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:

# 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

Time zone

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

Example:

# ln -s /usr/share/zoneinfo/Asia/Karachi /etc/localtime

Hardware clock

Set the hardware clock mode uniformly between your operating systems. Otherwise, they may overwrite the hardware clock and cause time shifts.

# hwclock --systohc --utc

Hostname

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 dhcpcd@enp38s0.service

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 “enp38s0”

Finishing base installation

Set the root password with:

# passwd

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

Sudo

Now we have to allow this use to do administrative jobs as sudo so let’s install sudo.

# pacman -S sudo

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

GRUB

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
# exit
# reboot

Installing display managers

install xserver

# pacman -S 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

https://wiki.archlinux.org/index.php/General_recommendations

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

Install Desktop Environment

# sudo pacman -S kde
# systemctl enable kdm.service
# systemctl start kdm.service

install network managers

# pacman -S kdeplasma-applets-plasma-nm

Audio management

# pacman -S alsa-utils pulseaudio kdemultimedia-kmix

Thats it start enjoy your arch linux !!!