Linux Resources Page
This is a written set of comprehensive instructions that will allow for a person to successfully install Arch Linux onto a machine with essential software to make a fully functional operating system. The proceeding instructions will allow for you to install the Arch base operating system, a working desktop environment and will also install the most up to date software. By doing that, you will not need to perform a system update upon completing your installation which saves you time.
Boot from the installation media and please follow the instructions carefully and once complete you will have a fully working operating system. The notes and instructions pertaining to each command are going to be in black text. The commmands themselves which are needed for installation are printed in a bold blue. Examples and syntax are in bold black. It is very important that you follow the instructions carefully and that you type the commands exactly as they are shown otherwise it may give you a broken system.
1.) Follow the on-screen instructions to connect wirelessly. You will need to use the arrow keys on your keyboard to select your wireless network and the tab key may be required. If you are connected via ethernet, this step will not be necessary. Move on to step #2.
2.) Executing this command will verify if your internet connection is working. If you get ping response times (usually 15 to 30 milliseconds) then your internet connection is working.
# ping -c 3 www.google.com
3.) You will replace 'sdX' with your block device name. Most block devices will be sda, thus the syntax is as follows (step #3a will show how this command is applied):
# parted /dev/sdX
3a.) If you are doing an installation on /dev/sda for instance you will go ahead and type the following:
4.) It will warn you about destroying all of the data on your hard drive. Type Yes to confirm.
(parted) mklabel msdos
5.) This is the syntax that is used to create the needed partitions to install Arch Linux. Step #5a is an example of how you will execute this command.
(parted) mkpart part-type fs-type start end
5a.) This is the actual command to create a primary partition for your hard drive using an ext4 filesystem with 30GB of disk space. You will need to adjust the disk space to meet the size of your specific hard drive and partition.
(parted) mkpart primary ext4 1MiB 30GiB
6.) This will set the boot flag on the partition you just created.
(parted) set 1 boot on
7.) This is going to create your swap partition. It is generally advised to create a swap partition equivalent to the amount of ram your system has. If you have a system with less than 2GB of ram then it is best for you to set your swap partition to 2GB. With a primary partition of 30GB as shown in step #5a and a swap partition of 2GB, you will execute the following command below:
NOTE: Once you are done with creating your partitions, quit parted and move on to the next step.
(parted) mkpart primary linux-swap 30GiB 32GiB
8.) You should be formatting the root partition of your drive at this point. If you are working with a fresh hard drive and doing a clean installation with nothing else on the drive, you will use the following syntax as shown below (step #8a is the proper application of this command):
# mkfs.ext4 /dev/sdxY
# mkfs.ext4 /dev/sda1
9.) We don’t need to touch the swap partition but it does need to be setup and activated. If you are doing a clean install on a blank drive you will likely be executing the following:
# mkswap /dev/sdxY
# mkswap /dev/sda2
10.) You are now activating the swap partition on your hard drive. If you are doing a clean, fresh installation it is very likely you will be using the following syntax:
# swapon /dev/sdxY
10a.) This is an actual command if you are using your second partition on a clean hard drive to turn on swap for /dev/sda2:
# swapon /dev/sda2
11.) We are going to mount the root partition of your hard drive, thus being the destination of your Arch Linux install. If you are doing a clean installation, you will most likely be using the following syntax to do so:
# mount /dev/sdxN /mnt
11a.) This is the actual application of the command to mount the root partition of your drive if you are doing a clean installation:
# mount /dev/sda1 /mnt
Once we have mounted the root partition, all of the ground work in preparation for installation has been completed. All we have left is to download and install the base operating system and supporting packages.
12.) You will be picking the fastest download mirror to obtain the base operating system and all of the supporting packages that come with it. The best thing to do is scroll down the list and find the closest one to your location. You can select the URL of your mirror by pressing Alt+6 (it will copy the entire line) then use the page-up key to move your cursor to the top of the list. To paste the line at the very top of the list, not the file iteself, press Ctrl+U. Once you are done, press Ctrl+X which will prompt you to save. Press Y, followed by Enter and you will go back to the command line.
# nano /etc/pacman.d/mirrorlist
13.) This will install the Arch base operating system onto your root partition. This will download 220MB of data.
# pacstrap -i /mnt base base-devel
14.) This command will only need to be run once. If you do get an error (very unlikely) you must edit the fstab configuration file and refrain from executing this command again.
# genfstab -U /mnt >> /mnt/etc/fstab
15.) We will now chroot into the newly installed system:
# arch-chroot /mnt
You will be selecting a language locale for your installation. Uncomment your locale by removing the "#" at the beginning of the line. For example, in English (Canada) we would uncomment the line that reads en_CA-UTF-8 and en_CA ISO-8859-1 ... press Ctrl+X to save, press "Y" to verify changes and then press Enter to close and return to the command prompt.
$ nano /etc/locale.gen
$ echo LANG=en_CA-UTF-8 > /etc/locale.conf
19.) The previous three commands enable your language settings as well as the user interface locale that you will see on your computer which controls things such as the date/time display.
$ export LANG=en_CA.UTF-8
20.) You will be selecting your time zone. Go through the prompts and select the time zone for your location. Once you are done with that you will need to create a symlink for it by executing the following command:
20a.) This command will be different for your area. For example if you are on the west coast of the United States, you would use /usr/share/zoneinfo/America/Pacific to symlink the time zone with your system.
$ ln -s /usr/share/zoneinfo/Canada/Newfoundland /etc/localtime
21.) This sets your system time to be in sync with UTC, thus it will be set to the universal coordinated time for accuracy.
$ hwclock --systohc --utc
$ nano /etc/pacman.conf
22a.) You are adding a repository called the AUR (Arch User Repository) however it will be called something different for this particular step. Scroll down to the very bottom of this file, press Enter twice to give yourself a blank line separating the last file entry from the new repository you will be adding. Goto the very end of the file and add the following repository information:
IMPORTANT! If you are installing a 64-Bit version of Arch Linux onto your system, you will need to scroll up and uncomment the [multilib] repository including the two lines below it. Press Ctrl+X, followed by "Y" and then press Enter to return back to the command prompt.
SigLevel = Never
Server = http://repo.archlinux.fr/$arch
23.) This will run a system update and include the new repository you just added so you can access the AUR.
$ pacman -Syyu
24.) This installs a very handy package called reflector. The purpose of reflector is to ping all of the Arch Linux servers that are closest to you, sort them based on speed and allow you to obtain packages faster. This is very helpful if you are using a slower internet connection.
$ pacman -S reflector
25.) This command shows that we would be obtaining the fastest servers for a user that is located in Canada. If you are in the United States, simply replace the country name with 'United States' (with the apostrophe before and after) and the command will obtain a list of the fastest servers in the United States and group them in your pacman.conf file with the fastest server listed first to streamline installing packages and running updates.
$ reflector --verbose --country 'Canada' -l 200 -p http --sort rate --save /etc/pacman.d/mirrorlist && pacman -Syyu
26.) This is a command installing a series of different, yet essential packages for your new system. These include display drivers, audio codecs, video codecs and the ability to read/write to external drives. This also includes the ability to unzip archives such as zip files and tarballs of all different sorts. Please make sure you type each package name correctly. You will be asked to either press a number for a certain package or press Enter to install all of them. Always press Enter to make sure you get that package plus any dependencies that are required to allow that package to run. Prior to downloading the files it will prompt you to continue with installation. Press “Y” (use caps) and then press Enter.
$ pacman -S bash-completion ipw2200-fw alsa-utils pulseaudio xorg mesa ttf-dejavu grub wireless_tools wpa_supplicant wpa_actiond dialog yaourt sudo os-prober grub-bios net-tools network-manager-applet pavucontrol unzip unrar p7zip a52dec faac faad2 flac jasper lame libdca libdv libmad libmpeg2 libtheora libvorbis libxv wavpack x264 xvidcore libgtop networkmanager pulseaudio-alsa afpfs-ng libnfs libcec lsb-release inxi cups opencl-headers cmake file-roller unace lrzip cdrkit gksu
27.) We are now going to install our desktop environment and display manager. Listed below are the desktop environments that are available and easily accessible for installation. The desktop environment’s proper name is on the left and the official Arch package name will be on the right:Cinnamon || cinnamon
Enlightenment || enlightenment
Gnome || gnome
KDE Plasma || kdebase plasma
LXDE || lxde
LXQt || lxqt
Mate || mate
Xfce || xfce4
To install your desktop of choice, you will type the following command below and this example will be for an installation of the KDE desktop environment:
$ pacman -S kdebase plasma
28.) You will now install your respective diplay manager. Listed below are the officially supported display managers that are available for immediate download. The display manager’s proper name is on the left and the official Arch package name will be on the right:GDM – Gnome Diplay Manager || gdm
KDM – KDE Display Manager || kdm
LightDM || lightdm
LXDE Diplay Manager || lxdm
SDDM || sddm
SliM || slim
X Display Manager || xorg-dm
To install your display manager of choice, you will type the following command below and this example will be for an installation of the KDE Diplay Manager, also known as KDM:
$ pacman -S kdm
29.) We now need to enable our display manager so we have a working graphical user interface (GUI) upon booting into our new system. The example command is to enable the KDE Display Manager. We will type the following command below:
$ systemctl enable kdm.service
30.) We now need to set up a hostname for our computer. A hostname is also the name that your wireless network will see in its list of connected devices, which is a good way to explain this. The example command shows that the computer’s hostname is being set to archmachine. Change that name to whatever you desire your computer to be called. To set your desired hostname, we need to type the following command:
$ echo archmachine > /etc/hostname
31.) We need to set the root password for our new Arch Linux installation. To set this, we will need to execute the following command and then press Enter. You will be prompted to type your new root password twice:
32.) One of the most important steps required when installing Arch, or any Linux operating system is to create a new user and set a password for that new user. For this command, we are going to create a new user with the name linuxguru, but do replace the word linuxguru with whatever you want:
$ useradd -m -g users -G wheel,storage,power -s /bin/bash linuxguru
33.) Next, we are going to create a password for our new user called linuxguru by executing the following command. We will also need to enter our new password twice to confirm it:
$ passwd linuxguru
34.) One thing that a lot of new Arch users don’t realize is how the AUR (Arch User Repository) compiles and stores packages on your system for future access, if the need arises. All default installations of Arch Linux will download, compile and store packages from the AUR in the /tmp directory which has a severely limited amount of space. We are going to fix that problem now by modifying the yaourt configuration file. To do this, we need to execute the following:
$ nano /etc/yaourtrc
34a.) Once the file opens, scroll down a bit to a line that starts with TMPDIR and make the line look like this:
NOTE: As you can see from above, we have set our new system to download, unpack and compile packages in the home directory of the new linuxguru user we just created. Uncomment the line by removing the "#" from the beginning of it if the hash mark is present. You will need to change the linuxguru directory to whatever username you picked in step #34. Once you have modified that line to read as it is displayed above, press Ctrl+X, followed by "Y" and press Enter to return back to the command prompt.
35.) This next command ensures that we have grub installed on our system and allows us to boot from a working base once we restart the computer. The command below looks as if we are solidifying a 32-Bit installation. Do rest assured that this is a multi-architecture command. Any 64-Bit installation requires this exact command as well so please don’t be alarmed by it. Please execute the following command below:
$ grub-install --target=i386-pc --recheck /dev/sda
36.) Now we are going to generate a grub configuration file to make sure we have a grub boot menu when we restart our machine. Please execute the following command:
$ grub-mkconfig -o /boot/grub/grub.cfg
37.) We are now going to start enabling our network devices. You will want to write them down as you will be needing to enable them one at a time. Two examples of how you will see them displayed may be enp2s0 for an ethernet connection and wlp2s1 for your PCI wireless card. To see a list of our network devices, type the following command:
$ ip link
38.) As mentioned in step #37, we will need to enable each device individually. To do that, we need to execute the following command, and we are going to use one of our example devices from the previous step. Enter the following command below for each internet protocol device:
NOTE: You will do this for each device. If you have an ethernet port you would execute systemctl enable email@example.com but make sure you have the device name correct otherwise you won’t have internet connectivity when you reboot.
$ systemctl enable firstname.lastname@example.org
39.) We need to enable our internet protocol devices to automatically start each time we boot by executing the following command:
$ systemctl enable NetworkManager
40.) An optional command to execute, although it may give you an error can be executed as follows:
NOTE: If it says you can’t execute this as root then do not worry about it. Chances are very likely that your network interfaces will start when you reboot the computer anyways.
$ systemctl start NetworkManager
41.) This next command will give you some programs to help you achieve a fully functioning desktop environment. This will install an office suite, an internet browser, email client, video/music players and some additional accessories as a good starting point. Once these are installed and you have booted into your new system, you may install other items to suit your needs, or, remove any of these items if they are found to be unncessary on your Arch Linux build. Please enter the following command below:
NOTE: It will prompt you to select specific packages. Keep pressing Enter until it asks you to contine with the installation, where you will press the "Y" key followed by Enter to proceed with downloading and installing the packages you have typed above.
$ pacman -S libreoffice gnome-terminal gedit firefox thunderbird vlc gimp flashplugin banshee xfburn gnome-system-monitor faenza-icon-theme numix-themes galculator evince hexchat glabels shairplay transmission-gtk
42.) Before concluding this installation tutorial, we want to give you an optional step to help with making your boot process a bit faster. Please consider these next two steps ONLY if you are doing a clean installation of Arch Linux, otherwise disregard and proceed to step #46. We are going to change the display time of the grub boot menu and to do that, we need to type the following command:
NOTE: When the file loads, find the line that reads GRUB_TIMEOUT=5 and make it look like this: GRUB_TIMEOUT=0 ... press Ctrl+X followed by "Y" to save and press Enter to exit.
$ nano /etc/default/grub
43.) We will need to update our grub configuration file by executing the following command:
$ grub-mkconfig -o /boot/grub/grub.cfg
44.) This tweak will allow for your bootloader to find the partition holding your Arch installation faster. To make this happen, execute the following command:
$ nano /etc/fstab
45.) When the file opens, you will see a series of lines with "0 1" and "0 0" respectively. Replace any "1" you see in that file with a "0" then save the file by pressing Ctrl+X, followed by "Y" then Enter.
46.) At this point, we are all done with our Arch Linux installation. We have created partitions, installed the base system, picked our desktop environment of choice, selected our display manager and installed some applications that will get us started. Now, we need to get ready for a restart of our computer and begin enjoying our desktop. To do this, type the following command:
47.) We will now restart the computer by typing this:
48.) Once the computer restarts, promptly remove the installation media and you will be booting into your new desktop. Type in your password to get into your new desktop.
49.) Please be advised beforehand that your wireless card may not allow you to connect with your local wireless network, however some desktop environments come preinstalled with their own network manager so you can simply click on the wifi network on the taskbar, type in any password required, click OK and you are good to go. In the possibility of not being able to access your wireless initially, open your terminal and type the following command:
50.) Once this is open, you will select the option that reads "Activate a connection". Press the down arrow key and then press Enter. Use the down arrow key again to highlight your wireless network. Once it is highlighted in red, press the Tab key which will then be highlighting an option that reads "Activate". Press Enter, type in your password, press Tab to select OK and press Enter. You will then connect to your wireless network. If you go to a different location, you will have to do the same thing to get on the local wireless network, however as mentioned before some desktop environments are already configured for a "point and click" approach. Once you have connected to your network, press the down arrow key to highlight on the "Quit" option, press Enter and when you get back to the terminal screen, type exit and press Enter again.
Arch Linux is one of the few rolling distrobutions which means you only install it once and updates never stop. As new kernels are released, your system will update/upgrade appropriately. As new software updates come along the same thing will happen. A general recommendation to Arch users is to run an update at least twice a week. Some of your updates will go quick while others may have a large sum of data to acquire and will take longer. No matter what desktop environment you are running, or software installed you will always be running the latest, yet stable releases of everything on your system.
To run an update there are two different update commands that you can execute. One only works with the standard Arch repository and the second works with the AUR. They are listed below:
sudo pacman -Syyu
yaourt -Syuua --devel
If, at any time you need help with your Arch Linux system there are several places you may go to receive support. The main source of support for Arch Linux is on the Freenode IRC network (chat.freenode.net) and the channel is #archlinux ... you do have to be registered on their network in order to be given assistance. Another option for a more personalized level of assistance can be given through AlaskaNet IRC (irc.alaskanet.us) via the channel called #linux. There we do offer support and assistance for all flavors of linux and all desktop environments.
One closing point we would like to make is the documentation for Arch Linux. You will quickly see and learn that Arch Linux is the most extensively documented Linux operating system in the world. All of the support documentation can be found in their Wiki (wiki.archlinux.org) and the docs for almost anything you can imagine are available in there as well.
Otherwise, we hope this installation guide has been helpful to you and as always...enjoy Arch!