Arch Linux is a great distro that boasts bleeding edge up-to-date rolling releases as well as a very light and efficient base install. There is no graphical install and it expects you to have some basic Linux chops already just to perform the installation. Beginners shouldn't be scared away though because Arch Linux has a great wiki and awesome documentation.
Arch Linux is a really good way to learn what's going on inside a Linux box. You can learn a lot just from the installation process. I am going to walk through the base install, as well as several common post-install things like setting up networking, sound, mounts, X11 and video drivers, and adding users. I am not going to go in great detail on each step, so if you don't know how to do a certain step you may need to seek references elsewhere.
Installing Arch Linux
First you need to obtain the ISO and burn to a disc or USB in order to boot your new machine from it. Download Arch Linux. It is a dual boot ISO so it is good for x86 and x86_64 (great, isn't it!) There is an install.txt file in the root users home folder when you boot for extra reference.
- Boot the ISO
- Run cfdisk and partition the drives. Simple installs will need a 1M BIOS Boot partition, a Linux Swap partition, and at least one Linux Filesystem partition.
- Run mkfs.ext4 and mkswap on your new partitions.
- Mount your new file system partition to /mnt.
- Run pacstrap /mnt. This will install the base system to /mnt.
- Run genfstab -U /mnt >> /mnt/etc/fstab
- Also set up any other mounts like /home, /var, or swap spaces (/dev/sdXX none swap defaults 0 0)
- Run arch-chroot /mnt
- Set a hostname in /etc/hostname. (echo myhostname > /etc/hostname)
- Run ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime. Use your time zone file.
- Edit /etc/locale.gen and uncomment your locale (en_US.UTF-8 in many cases.)
- Run locale-gen
- Edit /etc/locale.conf and put LANG=en_US.UTF-8 or the locale you used.
- Run mkinitcpio -p linux
- Run passwd to set the root user's password.
- Run pacman -S grub-bios os-prober
- Run grub-install /dev/sdb. Replace /dev/sdb with the drive you want to install the bootloader on. This will overwrite the MBR. If you don't know what that implies, you need to do some more preliminary reading on GRUB, bootloaders, and the MBR.
- Run grub-mkconfig > /boot/grub/grub.cfg. This will generate a GRUB menu list. Because we included os-prober package it will look for Windows and other operating systems and create menu items for them (convenient, huh!)
- Exit chroot. You can press CTRL-D to do this.
- Run umount /mnt
- Run reboot
Congratulations! At this point you should have a working Arch Linux system. It is pretty bare bones at the moment and needs a bit of configuration and additional packages to get things where we want it. If you are looking to set up a headless server, you can skip the section about X11 and graphics drivers, and probably the sound section too. Check out my follow up articles about Customizing Openbox and Customizing Gnome.
- Run ip link to get a list of your network devices
- Have it connect automatically at boot by running systemctl enable [email protected], supplying your network interface name.
- Add a user with useradd -d /path/to/homedir -m -G wheel myuser. The -m will tell it to create the home directory you specified. The -G supplies the default user group. Wheel is used for admins and we'll assume we are creating your personal user who SHOULD have admin group rights.
- Add the user to additional groups with gpasswd -a username groupname.
- Set the users password with passwd myusername.
- Install sudo with pacman -S sudo. Run visudo and uncomment the line with %wheel ALL=(ALL) ALL.
Mounting Drives (/etc/fstab)
- Install necessary packages to mount a variety of file systems with pacman -S nfs-utils nfs ntfs-3g gvfs.
- Manually mount an NFS drive with something like mount -t nfs -o nolock 192.168.1.67:/mnt/Storage /storage.
- You can have it mount at boot by adding this to the end of your /etc/fstab file: 192.168.1.67:/mnt/Storage /storage nfs nolock 0 0.
- For convenience you may want to place symlinks in your home folder to any mounted folders.
- ALSA should be configured by default but you need to unmute it and change volume first. Run pacman -S alsa-utils.
- Then run alsamixer to manage the volumes.
Video / X11 Desktop
For this demonstration I will be showing how to set up X11 with nvidia drivers.
- Run pacman -S xorg-server xorg-utils xorg-xinit nvidia pkg-config xorg-twm xterm to install X server, nvidia drivers, and the most basic utilities.
- Run nvidia-xconfig to generate the /etc/X11/xorg.conf file. Alternatively you can run Xorg -configure > /etc/X11/xorg.conf.
- Run startx to initiate X. This will bring you into the TWM with a couple xterms. It's ugly (to most people.)
- Install a desktop or window manager of your choice. Popular ones include fluxbox, openbox, gnome, and kde. I favor Openbox and Gnome for lightweight and feature-rich desktop, respectively. You can actually run Openbox as the window manager for Gnome if desired, but Gnome comes with its own (mutter.)
- Edit your ~/.xinitrc file to launch your desired window manager/desktop. Example: exec gnome-session
- For more information about getting your desktop set up, see my articles Customizing Openbox and Customizing Gnome. I cover everything including fonts, icons, mouse cursors, themes, wallpapers, and conky system monitor!.
Even more customization
For even more personalization, consider customizing any of the following items: .bashrc, .bash_profile, .vimrc, symlinks in home folder, bookmarks in Nautilus, conky, your desktop/window manager. Check out my other articles on Customizing Openbox and Customizing Gnome for more information on how to do this! I'll show you how to take your Arch Linux desktop even further with a totally customized desktop. It's a great feeling to have an entire desktop themes consistently with a look and feel that you are happy with. To me, that is the 'freedom' of free software that makes it so great. Granted, from a philosophical standpoint like Richard Stallman, customizing a desktop isn't the most important thing because free software is about freeing humanity from the chains of manipulative and oppressive software companies. Ok, so maybe those weren't his exact words, but he is the spear head of the free software movement and I think his hardcore philosophy is needed to set the real end goal, total software freedom. Anyway...
I keep a collection of zsh scripts and aliases in a GitHub repository. It contains a custom prompt that is much better than the default bash shell and other convenient shortcuts.
- Install zsh with sudo pacman -Syu zsh
- Change default shell with chsh and give it /bin/zsh
- Log out with exit or CTRL-D and log back in. Press q if given a zsh prompt.
- Install git with sudo pacman -Syu git
- Clone NanoBin with git clone https://github.com/NanoDano/NanoBin ~/NanoBin
- Log out and back in.
- vim - console text editor
- gedit - gtk text editor
- mc - console file manager
- nautilus - gtk file manager
- htop - improved top console system monitor
- xterm - simple console emulator
- gnome-terminal - fancy console emulator
- openssh - secure shell connectivity
- sshm - session manager
- zip - archiving
- unzip - archiving
- p7zip - archiving
- unrar - archiving
- baobab - disk management
- gnome-disk-utilities - disk management
- evince - document viewer
- eog - image viewer
- cheese - gtk webcam utiltiy
- gnome-screenshot - screenshot tool
- gnome-system-monitor - resource monitor
- gnome-system-log - log reader
- pidgin - instant messenger
- irssi - console IRC
- xchat - gtk IRC
- evolution - email client
- teamspeak3 - voice/text chat client
- xmms - media player
- svn - version control
- git - version control
- firefox - web browser
- chromium - web browser
- lynx - console web browser
- acidrip - DVD ripper
- gimp - image manipulation
- mpg123 - console music player
- sudo - convenient privelige escalation
- vlc - video player (Can play YouTube and other FLV video streams directly, without flash)
- libreoffice - Office suite (can use Firefox themes!)
- banshee - media player
- virtualbox - virtual machine manager
- rygel - UPnP streaming server
- gnome-nettool - Network manager
- nmap - port scanning
- vinagre - remote desktop
- seahorse - keyring management
These are packages I like to use and would include in my working desktop. I believe every one of these packages is in the Arch official repositories and can be installed without any AUR or custom repos.