Arch Linux Installation and Post-Install Customization
After using Fedora for 7 years it was time for a change, I wanted something light and fast that also gave me some geeky feeling. Then came Arch Linux, it has awesome installer, has no boaltware, and its all about DIY. So here goes my arch linux lnstallation and post-install customization procedure
Arch Linux Wiki has a good documentation on its installation. Found Here.
1. Pre-Installation Preparation
It all starts with downloading the ISO and creating a bootable media
1 | sudo dd if = /path_to_arch_ .iso of= /dev/sdX |
Now that you have the media, you need working Ethernet connection, you can use wireless if you can configure WPA2 and connect from terminal. I just took the easy way with ethernet. Note: you can also download the files and use from USB, Check it in wiki Here. However without working internet connection, you won’t just feel the benifits of Arch Linux.
You can test your connection by running
1 | ping -c 3 www.smjrifle.net |
2. Get those Partitions Ready
Next Step is to prepare your partition, you can create partition from other linux distribution and use it here, however since I missed geekiness of connecting wireless connection, I had to do this.
Note: If you are booting from CD, your hard disk is sda, if your booting from USB, it can be sdb or sdc.
you can check your Partitions using
1 | fdisk -l |
or
1 | cfdisk /dev/sda |
which gives bit graphical outlook to select/create partitions.
Now once, you have the partitions ready lets format it. Remember the partition numbers, you want for root and swap. Run these commands individually,
1 2 3 4 5 | $mkfs.ext4 /dev/sda1 mkswap /dev/sda2 swapon /dev/sda2 |
3. Time to install the base system
Lets mount your root partition,
1 | mount /dev/sda1 /mnt |
Lets install the base and developer’s packages now
1 | pacstrap -i /mnt base base-devel |
Important: Run the command below only once even if it gives error
1 | genfstab -U -p /mnt >> /mnt/etc/fstab |
Now check if the fstab has the correct partition, else you won’t boot. I ran into problems while using vi/vim so I am using nano. You can Save by pressing ctrl+x; Press Y to save or N to Discard then pres enter.
1 | nano /mnt/etc/fstab |
Finally, its time to login to your system eh!
1 | arch-chroot /mnt |
4. Language and location settings
With Arch linux you do everything youself in geeky way.
Run
1 | nano /etc/locale .gen |
It will open huge list of locals, uncomment the one you need by removing ‘#’ infront, if your english uncomment [en_US.UTF-8 UTF-8]
Now set the locale, by running these commands.individuallyy,
1 2 3 4 5 | locale-gen echo LANG=en_US.UTF-8 > /etc/locale .conf export LANG=en_US.UTF-8 |
Now configure the timezone, you can find zone and subzone by running
1 | ls /usr/share/zoneinfo and |
1 | ls /usr/share/zoneinfo/YOUR_ZONE |
mine was Asia/Kathmandu
Configure the clock by running
1 | ln -s /usr/share/zoneinfo/ {Zone}/{SubZone} /etc/localtime |
Configure the hardware clock by running
1 | hwclock –systohc –utc |
Configuring the Repos
You can configure repos by editing pacman.conf to do so run
1 | nano /etc/pacman .conf |
If you are using 64 bit system you should go ahead and enable (un-comment) the ‘multilib’ repo:
1 2 3 | [multilib] Include = /etc/pacman .d /mirrorlist |
Update the repos by running
1 | pacman -Sy |
5. Create users and password
Root Password is empty by default, set the root password by running
1 | passwd |
Now create user to access the system by running
1 | useradd -m -g users -G group_name,storage,power -s /bin/bash your_username |
Add password for user by running
1 | passwd your_username |
Now we need to add the user to list of sudoer’s, that is allow it to perform administrative tasks.
First Install Sudo, yes you need to install that too
1 | pacman -S sudo |
1 | pacman -Ss sudo |
Now allowing user of group_name to perform administrative tasks
run
1 | EDITOR=nano visudo |
Uncomment
1 | %wheel ALL=(ALL) ALL |
by removing ‘#’
Bonus: Install Bash completion package to auto complete commands by running
1 | $pacman -S bash -completion |
6. Install boot loader
Run the following commands, individually
1 | pacman -S grub-bios |
1 | grub- install --target=i386-pc --recheck /dev/sda |
1 | cp /usr/share/locale/en @quot /LC_MESSAGES/grub .mo /boot/grub/locale/en .mo |
If you are dual booting, have other os like other linux or crappy Wee-n-Dows you need OS Prober, run
1 | pacman -S os-prober |
Now Run the grub config to create grub Bootloader file
1 | grub-mkconfig -o /boot/grub/grub .cfg |
Finishing Installation
Now exit, run [$exit]
Unmount fs and reboot by running these
<
1 2 3 | umount /mnt $reboot |
7. Booting into your new Arch system
Now remove your USB/CD and the Arch Linux Boots into commandLine. You won’t have internet. So you need to connect to internet manually.
Run
1 | ip link |
to find out your network card name, it can be something like “enp4s0”
Enable and start your network by running
1 | sudo systemctl enable dhcpcd@.service |
1 | sudo systemctl start dhcpcd@{interface}.service |
where {interface} is your network card name;
Test your connection by running
1 | ping -c 3 www.smjrifle.net |
8. Installing X – “The graphical Display”
All you have seen till now is a black window with white font, now let’s bless those eyes with some GUI. To test if everything is working lets install the X by running
1 | sudo pacman -S xorg-server xorg-xinit xorg-server-utils |
Also install mesa for 3D support
1 | pacman -S mesa |
You need to Install your graphics driver, be careful what you select. You can refer to Arch Wiki Here.
All Almost done, now some input drivers, especially touchpad for Laptops
Run
1 | pacman -S xf86-input-synaptics |
Now for test default desktop environment
1 | pacman -S xorg-twm xorg-xclock xterm |
now boot into graphics by running
1 | startx |
If everything is fine you will see windows, you can type exit in terminal to exit the desktop and continue to install preferred Desktop Environment. If you get blank screen, reboot and run the following command.
1 | grep EE /var/log/Xorg .0.log |
It will show what errors have occured, check if it gives any graphics driver error if so remove what you installed and install the driver specified there and test again.
9. Getting your favourite Desktop Environment
I recommend you install Gamin first then you install the desktop environments.
1 | pacman -S gamin |
You can now install any desktop environment: Gnome, KDE, Cinnamon. I will install LXDE for me by running. You can install multiple too.
1 | sudo pacman -S lxde |
Here are the list of supported desktop environment. Click Me.
you can run
1 | sudo pacman -S desktop_environment_code |
The code are small case names in wiki to the right of URL’s of Desktop Environment.
Now install a display Server, GDM for Gnome Based, KDM for KDE Based I installed LXDM for me.
1 | sudo -S lxdm |
Then enable and start the service
1 | systemctl enable lxdm.service |
1 | systemctl start lxdm.service |
I had to run the following command to get my Display Server booted up at startup
1 | echo 'exec ck-launch-session dbus-launch startlxde' > ~/.xinitrc |
It consists of startlxde, different desktop environment might have different thing, however it might not be necessary for KDM or GDM.
Now reboot You will be presented with login Screen. Login and get ready for Post Installation customization.
10. Post-Installation Customization
When you have booted to the desktop, you will notice it lacks many applications. Lets install them using pacman (<
Some apps are available from AUR. Bookmark this link Arch User Repository
Pacman options:
-S Sync/Install
-R Remove
-U Update
-Ss search
I recommend you start with wget
wget:
1 | pacman -S wget |
Git:
1 | pacman -S git |
Mercurial/hg:
1 | pacman -S mercurial |
Flash Plugin:
1 | pacman -S flashplugin |
Zip, 7z: pacman -S p7zip unrar zip
SSH:
1 | pacman -S ssh |
Archive Manager:
1 | pacman -S file -roller |
Filezilla:
1 | pacman -S filezilla |
Gparted:
1 | pacman -S gparted |
Gimp:
1 | pacman -S gimp |
VLC:
1 | pacman -S vlc |
mplayer:
1 | pacman -S mplayer |
RhythmBox:
1 | pacman -S rhythmbox |
Totem Video Player:
1 | pacman -S totem |
Firefox:
1 | pacman -S firefox |
ThunderBird:
1 | pacman -S thunderbird |
Opera:
1 | pacman -S opera |
Chromium:
1 | pacman -S chromium |
Transmission:
1 | pacman -S transmission-gtk transmission-cli |
Chrome:
1 2 3 4 5 6 7 | wget https: //aur .archlinux.org /packages/go/google-chrome/google-chrome . tar .gz tar -xvf google-chrome. tar .gz cd google-chrome makepkg -si -skipinteg |
Gedit:
1 | pacman -S gedit |
Geany:
1 | pacman -S geany |
Sublime: [Go the download page of Sublime and download
1 2 3 4 5 6 7 8 9 10 11 12 13 | tar -xvf "Sublime Text 2.0.2.tar.bz2" Note: the 2.0.2 maybe different in your case . mv Sublime Text 2 /opt ln -s /opt/Sublime Text 2 /sublime_text /usr/bin/sublime sublime /usr/share/applications/sublime .desktop sublime /usr/share/applications/defaults .list sudo chown -R root:root "/root/.config/sublime-text-2" |
Acrobat Reader:
1 2 3 4 5 6 7 | wget https: //aur .archlinux.org /packages/ac/acroread/acroread . tar .gz tar -xvf acroread. tar .gz $ cd acroread/ $makepkg -s -i |
Apache:
1 | sudo pacman -S apache |
Open config File
1 2 3 | sudo gedit /etc/httpd/conf/httpd .conf Comment out this line #LoadModule unique_id_module modules/mod_unique_id.so |
Mysql:
1 2 3 4 5 6 7 | sudo pacman -S mysql sudo systemctl start mysqld sudo mysql_secure_installation sudo systemctl restart mysqld |
PHP:
1 | sudo pacman -S php php-apache |
Add php to httpd conf open
1 | sudo gedit /etc/httpd/conf/httpd .conf |
Paste the following
1 2 3 4 5 6 7 | # Use for PHP 5.x: LoadModule php5_module modules /libphp5 .so AddHandler php5-script php Include conf /extra/php5_module .conf |
1 | sudo systemctl restart httpd |
Uncomment mysql in php.ini, open php.ini
1 | sudo gedit /etc/php/php .ini |
Uncomment the following lines(remove ‘;’)
1 2 3 | extension=mysql.so extension=mysql.so |
Start php and mysql at startup, Run
1 | sudo systemctl enable mysqld httpd |
True Type Font:
1 | pacman -S ttf-dejavu |
11. Some Trouble Shooting
Network Manager
If you cannot connect to wirelessor find Network Manager, then
//Enable Wireless
1 | pacman -S wireless_tools |
For GNOME/Xfce/LXDE users:
If you’ve installed GNOME, Xfce or LXDE as your preferred desktop environment during the initial Arch Linux installation, you will have to execute the following commands in a Terminal, one by one, hitting Enter after each one:
1 2 3 4 | sudo pacman -S network-manager-applet sudo systemctl enable NetworkManager $ sudo systemctl start NetworkManager |
If you’ve used another GNOME-based operating system before, you probably know that NetworkManager is the default and only network management application for the GNOME desktop environment.
It is installed by default in Arch Linux, but for some reason, it is not enabled. This is what we do with the above commands. That’s it! You’ll see the NetworkManager Applet icon in the tray area, from where you can connect to your wireless network.
For KDE users:
If you’ve installed KDE as your preferred desktop environment during the initial Arch Linux installation, you will have to execute the following commands in a Terminal, one by one, hitting Enter after each one:
[$sudo pacman -S kdeplasma-applets-networkmanagement]
[$sudo systemctl enable NetworkManager]
[$sudo systemctl start NetworkManager]
[$sudo systemctl disable dhcpd.service]
If you enabled or installed another service, in my case netctl make sure you uninstall it in order to use Network Manager.
Mounting NTFS
Install ntfs-3g by
1 | pacman -S ntfs-3g |
Then follow this post
Fix Heating Issues/Switchable Graphics
Follow this post