Up until recently I have almost only been using Linux Mint as my main computer's operating system. However I was always interested in Arch Linux: full freedom out of the box, up-to-date software from the official repositories. Now it was finally time to upgrade my computer and I took the chance to install Arch Linux.
Test in VirtualBox
Before I started installing it on my computer and getting stucked, I first gave a list of instructions a try in VirtualBox. I installed the base packages and a desktop environment (KDE Plasma) and it was surprisingly easy for me to get everything running. The next step was go apply this to my actual computer.
Ready to install
After my success attempt within VirtualBox, I created a bootable USB stick with the Arch Linux ISO and booted from it. I created a backup of all my valuable data and replaced the hard drive in my computer, so there was nothing important that could accidentally be deleted.
After selecting my USB stick from the boot menu to boot from, I entered the Arch console, where I could start typing commands.
The first thing, I did, is checking internet connection. My computer is connected via a LAN cable - the same as simulated in VirtualBox before - so pinging any domain using the ping
command should work. It did not.
I did some research and eventually figured out that "only" DNS resolving was not working. Doing ping 1.1.1.1
or any other specific IP address worked out of the box. I was suggested to check /etc/resolv.conf
for an entry for nameserver
. There was actually one, pointing to something in the 127.x.x.x
space. I replaced it via nano
with two other nameserver
lines pointing to 1.1.1.1
and 8.8.8.8
, tried ping <some-domain>
again and now it was working. Phew! Let's make sure NTP for time sync is enabled via timedatectl set-ntp true
and continue with the actual installation process.
Disk partitioning
In my case, I have two disks installed in my computer. One HDD, one much smaller but faster SSD. They are identified as /dev/sda
and /dev/sdb
respectively. I used cgdisk /dev/sda
and cgdisk /dev/sdb
to partition these. "Partition" basically means to subdivide each drive into smaller so-called partitions so each of them can later be formatted using a specific filesystem and use. For example, one dedicated partition is required for the boot data, I want a dedicated one on the fast SSD for the actual system and two other ones on the slower but larger HDD for my home and personal files.
I formatted my disks like this:
- 1 GB (SSD) using FAT32 (type
EF00
) for/boot
(/dev/sdb1
) - 16 GB (SSD) for Swap (type
8200
) (/dev/sdb2
) - remaining SSD space for system
/
using ext4 (type8300
) (/dev/sdb3
) - Some amount of HDD using ext4 (type
8300
) for/home
(/dev/sda1
) - Remaining amount of HDD using ext4 (type
8300
) for/files
(here I put almost all of my personal, user-independent files) (/dev/sda2
)
After confirming and writing all the partitions, it's time to actual format and mount the partitions.
I used mkfs.fat -F32 /dev/sda1
for the boot / EFI partition (it is required to be FAT32). mkswap /dev/sdb2
for the swap. And mkfs.ext4 /dev/sda1
etc. to format the remaining partitions for using the ext4 filesystem, which is the most common filesystem for Linux system (alongside with the newer btrfs).
After formatting all the disks, it's time to mount them so I can actually access their contents and install data on them:
mount /dev/sdb3 /mnt
mkdir -p /mnt/{boot,home}
mount /dev/sdb1 /mnt/boot
mount /dev/sda1 /mnt/home
For your understanding: everything, that is found in /mnt
during the installation progress, will later be the actual root /
on the final system (and temporarily during installation when we use arch-chroot
in a few minutes).
Installation and configuration
Right now, /mnt
is basically empty. There are no programs, no configuration, no anything. The following command installs the Arch Linux base system there:
pacman -K /mnt base base-devel linux linux-firmware linux-headers nano networkmanager amd-ucode
Please note since I have an AMD processor, it's reommended to have amd-ucode
for bug and security fixes for my AMD processor. For Intel processors, there would be intel-ucode
. On my previous computer (Linux Mint), both of them were installed, but I don't believe you need both of them if you only have either processor.
Next I did some basic straight-forward configuration:
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
hwclock --systohc
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
# You can choose any name for your computer you like.
echo "arch-linux" > /etc/hostname
cat >> /etc/hosts <<EOF
127.0.0.1 arch-linux
::1 arch-linux
127.0.1.1 arch-linux.localdomain arch-linux
EOF
I do have some specific setup using various groups and additional "users" (when accessing files via the network), but I will mostly skip these as for this article. Essentially, I used the groupadd
to create certain groups with specific IDs (since I hade the same IDs on my backup that I'll restore later). The most essential commands to execute for user setup are:
useradd -m -u 1000 -G wheel -s /bin/bash tenry
passwd tenry
And typed my personal password I wanted to use for my account. The membership of the wheel
group is used to allow my command to sudo
any commands. To make this possible, I had to run EDITOR=nano visudo
next and uncomment the line near the bottom mentioning %wheel ALL=(ALL:ALL) ALL
.
Bootloader
Next I installed a bootloader, so when the computer starts, that it would find my Arch Linux installation and boots it. I used systemd-boot, for no specific reason. I also know GRUB and there are other options available too.
For installing systemd-boot, I ran the following commands:
bootctl install
cat > /boot/loader/loader.conf <<EOF
default arch
timeout 3
editor 0
EOF
cat > /boot/loader/entries/arch.conf <<EOF
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=PARTUUID=$(blkid -s PARTUUID -o value /dev/sdb3) rw
EOF
Pay special attention to the part mentioning /dev/sdb3
. This is where my root partition is located. If it was on a different partition, this has to be adjusted accordingly.
Extras
Now the base system should be ready. But before finishing up and booting into my system, there were certrain extra things I wanted to install (it could also be done afterwards). The system may be fully ready for some people to use from here, if you do not intend to have any GUI, for example, if you are only using this computer as a server. In my case however I wanted a full GUI right when booting into the computer.
First, the network manager should be enabled using systemctl enable NetworkManager
.
Next, since I have an Nvidia graphics card in my computer (GeForce GTX 1060, to be specific), I wanted the (proprietary) nvidia drivers to be installed. I did so using pacman -S nvidia nvidia-utils nvidia-settings
.
Then I installed certain packages. For the desktop environment, there are many options, available, such as Cinnamon (which I'm used to from Linux Mint), KDE Plasma and more. After my first glance at KDE Plasma in VirtualBox, I wanted to give this a chance and installed it using pacman -S plasma
.
When starting the computer, you would usually be in a terminal, where you log into an account and you would then have to manually start the desktop environment (Plasma in my case). I prefer however to have a nice looking login screen. For that, I installed lightdm using pacman -S lightdm lightdm-gtk-greeter plasma
.
To tell the computer to start Plasma on user login, I had to put a line into my user account's .xinitrc
file:
echo "exec startplasma-wayland" > /home/tenry/.xinitrc
chown tenry:tenry /home/tenry/.xinitrc
Plasma supports the legacy X11 window system (the same I had on Linux Mint) and the modern, to some degree experimental Wayland. By "experimental", I mean that many programs might still have issues with Wayland. If anything, that is important for me, would not work well with Wayland, I can simply use startplasma-x11
instead.
EDIT: Actually, the .xinitrc
file does not affect which desktop to start upon login (via a display manager like lightdm). This is only when you use the startx
command from the command line. In the case of lightdm, there is a little config icon in the top right where I can choose the desktop environment before logging in.
I also installed additional packages using pacman -S <package1> <package2> ...
for my personal needs, some of these are:
-
terminator
for the terminal -
firefox
for the browser -
thunderbird
for e-mails -
dolphin
for file browsing -
audacious
as the audio player
A few essential programs are still missing, such as a simple image viewer. I will install those later.
Final cleanup and booting issues
Now everything should be ready, so I used the following commands to exit the installation process and reboot the computer:
exit # exiting from arch-chroot
umount -R /mnt
reboot
In the BIOS boot settings, I ensured the order so my SSD, which had the EFI installed, was on the first place, and booted into Arch Linux from that.
I saw some text on the screen, starting to initialize some things, but it hang up very quickly. Luckily, the text on the screen gave me the hint where something is wrong. Essentially it told me something about not being able to find something with PARTUUID=$(blkid -s PARTUUID ...
.
I restarted my computer and booted from the USB stick again, so I can investigate the installation configuration. Something appeared to be off in /loder/entries/arch.conf
on my boot partition. I did have a typo there which I fixed, but I was still not able to boot. It appeared that for some reason my installation would not be able to run $(blkid -s ...)
, even though the same was working on my VirtualBox test before. Even after typing the blkid
command manually, it gave me an actual uuid. I decided to replace replace the inline command with the actual, hardcoded UUID. This is also where I learned there is a UUID
and a PARTUUID
, and depending on which ID from the blkid
command I'm using, it must be either UUID=...
or PARTUUID=...
in the arch.conf
file.
Finally I was able to boot successfully into Arch! But... there was no login screen. Not a graphical one. There was only the terminal asking me for credentials. Looks like lightdm
was not starting. Quickly I realized I forgot to execute one more command which I was supposed to execute right after installing lightdm
: systemctl enable lightdm
. So, in the terminal, I logged into my account, ran this command manually and restarted.
EDIT: It appears that the Plasma installation comes with the "SDDM" login screen, but it was not enabled automatically in my case. If you want to switch from lightdm to SDDM, simply do systemctl disable lightdm && systemctl enable sddm
as sudo.
Now I actually had a graphical login screen! Not very beautiful, as the background is fully black, for example, but I'm happy so far! Now, after typing in my credentials to log in, it would actually also start the Plasma desktop interface and basically everything I needed was working! I had internet, I had music, and the nvidia drivers appeared to be working too.
After installation
Of course, minor things were still missing or not configured according to my needs, which I install or configure one after another. For example, LibreOffice was missing, I installed it using pacman -S libreoffice-fresh
. My keyboard layout was set to default US, but I prefer "US International" (which allows me to type many more special characters), this I configured in the settings provided to my by Plasma. Japanese characters in browser and mail were missing, so I installed additional fonts and Japanese characters could be displayed on my screen.
Summary
As of writing this article, this is basically my first day of actually using Arch Linux with Plasma, after I have been using Linux Mint with Cinnamon for many, many years. As of now I'm very happy with everything and I'm looking forward gathering more experience with Arch Linux - hopefully mostly positive ones.
Do you have experience with Arch Linux? What do you think about Arch Linux, compared to easier-to-use systems like Ubuntu or Linux Mint? Let me know in the comments!
Top comments (0)