What is Arch Linux?
Arch Linux is a Linux distribution designed for computers with X86-64 processors. It was created by Judd Vinet in 2002. The main idea behind this distribution is speed, flexibility, and simplicity. Arch Linux focuses on centralized configuration, similar to Gentoo Linux.
Arch Linux follows the rolling-release model system, meaning that the packages are available for a brief time after they are released. The pacman package manager is the most important feature that distinguishes Arch Linux. It offers management for packages in its repository as well as users’ own builds.
The goal of Arch Linux is to keep configuration simple. While simplicity is the philosophy, the configuration process is not for beginners. Fortunately, you have this guide on how to install Arch Linux. It also includes some optional configurations from which to start.
How to Install Arch Linux
In this tutorial, you will see how to successfully install Arch Linux. The installation can present a challenge for beginners and some Linux enthusiasts, but following these detailed steps will make things easier.
Step 1 – Download and Boot Arch Linux
- Download Arch Linux .iso file.
Step 2 – Prepare the Installation
- In the terminal prompt that appears, set your keyboard layout. In the example below, US stands for the United States keyboard layout.
localectl list-keymaps | grep US
- Set your keyboard layout.
- If you have a Wi-Fi adapter, enable it with the following command.
- You can find the name of your network adapter using the device list command.
- The following command allows you to scan for wifi networks. Replace name_of_your_wifi_adapter with your device’s name.
station name_of_your_wifi_adapter scan
- Use the following to see the list of available networks. Again, replace name_of_your_wifi_adapter with your device’s name.
station name_of_your_wifi_adapter get-networks
- Connect to your network. Replace name_of_your_wifi_adapter with your device name and name_of_your_network with your network name.
station name_of_your_wifi_adapter connect name_of_your_network
- In order to go back to the Arch root .iso, type exit.
- Now that you have an Internet connection, you can synchronize the network-time protocol with the following command.
timedatectl set-ntp true
- Packages must be installed from a list of official Arch Linux servers called mirror servers. Ust the following command to set the fastest mirror list available for you.
reflector -c 'United States' -a 12 - -sort rate - -save etc/pacman.d/mirrorlist
The -c stands for country. If your country has a two word name, you have to put them through single quotes, as the United States is in our example above.
The -a stands for the age of the servers. In our example, 12 denotes servers that have been updated in the last 12 hours.
The --sort portion is to sort the servers by speed.
The --save will let you save this information under etc/pacman.d/mirrorlist.
- Synchronize your mirror servers with the following command.
- Use the lsblk command to list your disks so you can partition them and install Arch Linux.
Step 3 – Partition the Disk (UEFI Systems Only)
In this step, you will create two partitions that are mandatory, the extensible firmware interface (EFI) and root partitions. The home partition is optional.
Even though the unified extensible firmware interface (UEFI) system supports both master boot record (MBR) and GUID partition table (GPT), you will partition the disk with the GPT label using gdisk because of the MBR partition’s limitations in size and number of the partitions.
- Create new GPT entries in memory using the following command.
- Type n to create a new entry.
- The system will partition number 1 by default, so just press Enter.
- In the first sector, accept the defaults.
- In the last sector, choose how big you want the partition to be. The below command would set the partition size to 200 megabytes.
- This will be an EFI partition (currently, it is a Linux file system). The code for the EFI system partition is ef00, which is what you want to input.
- You will type n for a new partition (the root partition) and accept the number 2 as default.
- For the first sector, accept the defaults.
- For the last sector, hit Enter. It will use the remaining space that is left on the disk.
- The default is the Linux file system, so the code is already good. Accept defaults and hit Enter.
- Type w to write the changes to the disk.
- Once the operation has been completed successfully, you will format the partitions using the following command. The EFI partition must be a file allocation table (FAT) system type. You will specifically create a fat32 file system and the device name.
mkfs.fat -f32 /dev/dsk1
- You have to repeat the process for the root partition.
- Mount your root partition with the following command.
mount /dev/dsk2 /mnt
- You will mount your EFI partition, but first, you have to create a directory for it. Use this command to accomplish that.
mkdir -p /mnt/boot/efi - mkdir
The -p is used to create multiple directories. If you want to create just one, you can just use mkdir. The directories you want to create are boot and EFI to mount the EFI partition in this specific directory. Also, you can mount the EFI partition onto the boot directory if you prefer.
- Mount dsk1.
mount /dev/dsk1 /mnt/boot/efi
- You can see everything you have written and mounted using the lsblk command.
Step 4 - Partition the Disk (MBR Systems Only)
MBR requires a disk operating system (DOS) disk label.
- Use the following command to format a disk.
- Type n to create a swap partition.
- Accept the default for the primary partition and the first sector. The last sector defines the size of the swap partition.
The basic rule is to create double the RAM memory size. For example, if you have 2 GB of RAM, your swap partition should be at least 4 GB. Type 4G and hit Enter.
- You will need to change the created partition type from Linux to Linux swap. Type t. The code for a swap partition is 82.
- Next, we have to create the root partition. Type n.
- Accept the defaults for the primary partition, partition number, first sector, and last sector.
- Hit w in order to write these changes to the disk.
- Use the following commands to activate the swap partition.
- Format and activate the root partition.
- Mount the root partition.
mount /dev/vda2 /mnt
Step 5 - Install the Base Packages (UEFI and MBR Systems)
Installing base packages is crucial in order to have a running system. Some of the base packages that we will install are:
- Linux firmware, which will provide additional firmware for the system.
- Linux kernel.
- Intel-ucod (for Intel processors).
- Amd-ucod (for AMD processors).
- Vim or nano (orpackages for the text editor that you prefer).
- Use the following command to install the base packages in the mount directory.
pacstrap /mnt base linux-firmware linux intel-ucod vim
- Generate the file system table, which is where the file mount points are stored. Every time the device boots up, it will check this file to see what should be mounted.
genfstab -U mnt >> /mnt/etc/fstab
Step 6 – Start the Arch Linux Installation
Thus far, the previous steps were preparation for the actual Arch Linux installation. The last steps will pertain to the installation.
- Mount into the installation.
- Set the timezone of the system. Replace America/New_York with the appropriate country/location for your system’s timezone.
ln -sf usr/share/zoneinfo/America/New_York/ etc/localtime
You can look up the configuration for your location using the following command. Replace your_city_name with the city your system is located.
timedatectl list-timezones | grep your_city_name
- Synchronize the system and hardware clock.
- Configure the locale.gen file, which contains the locales for the system. For this tutorial, we are using the Vim text editor.
Scroll down in order to find the locale you want to use and remove the # from the start of the line containing the language you prefer. Save the file and exit vim using the :wq! command.
- Generate the locales.
- Create the locale.conf file.
Enter your preferred locale. For the United States, enter the following.
Save the file and exit vim using the :wq! command.
- Set the hostname. The hostname portion will be your device’s hostname.
- Set the host file.
On the empty line enter. Where yourhostname appears, you will enter your device’s hostname.
127.0.0.1 localhost ::1 localhost 127.0.1.1 yourhostname.localdomain yourhostname
- Set a password for the root user using the passwd command.
Step 7 - Install Additional Packages
The default package manager in Arch Linux is pacman. Pacman runs perfectly with the Arch Build System. In order to install a package using pacman, you have to use the -S option.
- Install additional packages using pacman:
pacman -S networkmanager network-manager-applet grub mtools dosfstools git linux-headers
bluez-utils bluez pulseaudio reflector xdg-utils xdg-user-dirs cups
The Arch Linux website provides a list of all available packages.
- Install the grub bootloader (on UEFI systems only).
grub-install -target=x86_64-efi -efi-directory=/boot/efi -bootloader-id=GRUB
A configuration file for grub needs to be generated.
grub-mkconfig -o /boot/grub/grub.cfg
- Install the grub bootloader (on MBR systems only).
grub-install -target=i386-pc /dev/dsk
A configuration file for grub needs to be generated.
grub-mkconfig -o /boot/grub/grub.cfg
- Make sure that the network manager is enabled so you can configure the Wi-Fi.
systemctl enable NetworkManager
Step 8 - Create a User and Set a Password
For the purpose of this tutorial, our user will be johndoe. Replace johndoe in the user and password commands with your own personal username and password.
useradd -nG wheel johndoe
Step 9 – Finish the Installation
Those were all the basic steps of how to install Arch Linux. Now we have to exit the installation, unmount all partitions, and reboot the machine. You will use the following commands.
Step 10 – Arch Linux Customization
If the grub bootloader was installed correctly, you will be able to select Arch Linux to boot. You can log in using credentials for the user you created. When you have logged in, you can continue the boundless Arch Linux configuration this operating system is famous for.
The following are optional, depending on your preferences, but are helpful in most use cases.
- Before you install a desktop environment, you have to install X server, one of the most used display servers.
sudo pacman -S xorg
- After the X server installation is complete, choose your preferred desktop environment.
sudo pacman -S cinnamon nemo-fileroller
sudo pacman -S gnome gnome-extra
sudo pacman -S xfce4 xfce4-goodies
sudo pacman -S mate mate-extra
- Install codecs and plugins.
sudo pacman -S faac faad2 flac jasper lame libdv a52dec libtheora x264 gstreamer0.10-plugins
libmad libvorbis wavpack
- Install additional software for day-to-day use. For this tutorial, the command below will install:
- Gedit (another text editor).
- Thunderbird (email client).
- Pidgin (instant messaging client).
- VLC (media player).
sudo pacman -S libreoffice gedit skype firefox thunderbird pidgin vlc
- Install archive managers.
sudo pacman -S tar unrar p7zip p7zip-plugins rsync
Customization is limitless, which is the real power of this operating system. You can customize almost everything in Arch Linux, such as the desktop environment, themes, and the mouse pointer. If you are willing to learn more about Arch Linux, you can visit the Arch Linux wiki.
Our Sales and Support teams are available 24 hours by phone or e-mail to assist.