Philipp Conen

Engineering meets hobby.

Setting up Arch Linux on an Acer Aspire 5742G

As an computational engineering student, I found it useful to upgrade my Linux skills. Also, I wanted to check out the benefits of getting back control of my system.

First, I want to point out that for custom users who never had contact with a non-automatic installed Linux distribution the installation could take a few hours. For me, it takes more or less two days for the installation, because I ran into some issues. Arch Linux is also a bit more tricky to install when handling old hardware as in my case. The system I set up was an Acer Aspire 5742G Laptop.

For the first try of the installation, I stuck to the official guide. Later I also looked up the german guide cause it slightly differs from the official guide.

The essential steps of the installation I go through with you are:

  1. Burn the installation image
  2. Set up the keyboard to perform better during installation
  3. Set up an internet connection for the installation
  4. Check whether the hardware supports BIOS or UEFI boot mode
  5. Update the system clock
  6. Partition the memory device (HDD or SSD)
  7. Formatting the partitions
  8. Mount the partitioned and formated memory device to the installation environment
  9. Installation Arch on the memory device
  10. Basic settings after installation
  11. Install a boot loader
  12. Finish and first boot on terminal-based Arch
  13. Setting up a graphical user interface (GUI)
  14. Configure the system for custom needs

You also can verify the installation image. I must admit, that I skipped this aspect because of time restrictions.

1. Burn the installation image

This is the easiest part of the installation. Just download the Arch installation image and use Balena Etcher to burn the image on a USB stick. Balena is pretty straightforward in the way of using it. First, select the location, second chose the stick where you want to burn the image to, and lastly start the burning process.

2. Set up your keyboard (optional)

The whole installation will take place in the terminal, thus without any graphical support and especially in English. If you are not native English you might be a bit confused about the English keyboard layout. So to set up the keyboard layout to a known layout could help during the installation process. To change the keyboard to a German layout simply type

loadkeys de-latin1

If you like to use other layouts check out the possibilities with

ls /usr/share/kbd/keymaps/**/*.map.gz

3. Set up an internet connection (for the installation)

If you only need a wired connection (LAN) this would be the easiest way. But don’t be afraid of getting your wifi running. Remember that at this point of time you set up the connection on the live environment. Thus this connection will disappear after installation.

To enable wifi, you first need to find out your network interface (device) with ip link. For me, the device is called wlan0.

With this information go into

iwctl

To now connect via wifi you need to know the SSID of the network you want to connect to. If this information is not available to you hit

station device get-networks # remember to use your device-name (e.g. *wlan0* for me)

With knowing the correct SSID you can connect by entering

station device connect SSID

and enter the password afterward.

With

exit

you can leave the iwctl mode.

To check if the connection is up, you can try to ping a website.

ping google.com

4. Check boot mode (BIOS or UEFI)

By trying to list the directory

ls /sys/firmware/efi/efivars

you get feedback from your system.

If the directory does not exist, you made sure your hardware is running with BIOS. This is often the case if your system is using old hardware. In tricky cases, you can also try to get this information by taking some research on your system and the hardware components.

5. Update the system clock

For this chapter simply type

timedatectl set-ntp true

Don’t be confused if the time (UTC) does not match your real timezone. This issue will be tackled later.

6. Partition of the memory device

For me, this was the hardest part of the installation process, because I had no idea what to do and I was afraid of damaging my system. You can hinder this fear by being sure that there is nothing on your system left, that could be important for you.

At this state of time, you have to make sure whether you are using BIOS or UEFI and which boot loader you like to use on your system. As I didn’t hat this information present during this aspect, I needed to rerun the installation process, because I found myself in a miss matchup.

If you are acting on a BIOS system you have two options for the boot loader. These are Grub and Syslinux. As Syslinux didn’t work out for me, I tried to install Grub. Here I ran into the above-mentioned problem, due to the wrong partitioning, because Grub requires a partition space of at least 1MB on your memory device. Also, I used the wrong file system.

Rerunning this process I went on with the german guide in the use of gdisk because the process is declared in detail. I want to translate this information into English for beginners like me.

So to set up the partitioning for BIOS boot mode using Grub boot loader you need to enter gdisk within the correct device.
To explain this in a really quick way, you will find differing letters for the devices (x) and also differing partition numbers on each device (y) - e.g. /dev/sdxy. As an example, during installation, you can find a device sda and a device sdb where sda should be the memory device of your system and sdb your installation stick. On sda you can maybe also find different partitions (sda1, sda2, ..).

Returning to the partitioning you can find the compact instructions for a BIOS system using gdisk in the following with additional comments behind the #

gdisk /dev/sda # Entering gdisk environment on your system memory device ('a' can differ)
o # Create a new and empty partition table - don't worry nothing will change until you explicitly save
y # Accept 
n # Create a new partition for BIOS - e.g. /dev/sda1
Enter # Confirm with Enter-button for default partition-number
Enter # Confirm with Enter-button for the default starting sector of your partition memory
+1M # This will create the partition size by counting 1MB starting at the memory sector you recently created by default
ef02 # Advise the 1MB BIOS partition to an ef02 file system - this is required for BIOS
n # Create a new partition for the rest of your system - e.g. /dev/sda2
Enter # Confirm with Enter-button for default partition number
Enter # Confirm with Enter-button for the default starting sector of your system memory - this would be the end of the existing sector
Enter # Confirm with Enter-button for the default ending sector of your system memory - this would fill the partion with the post existing memory capacity
Enter # Confirm with Enter-button for default Linux partition-type (8300)
p # Print the actual (new) partition table you recently created
w # Save the actual partition table you recently created
y # Confirm

Tip:
As a friend mentioned it is always useful to have at least a bit of memory space in an empty partition, I also created an empty partition of 10 GB. For this, I added the following steps between the steps ef02 and n (after creating the BIOS partition). Of course, this is optional:

n # Create a new partition as buffer  - e.g. /dev/sda3
3 # Type 3 and confirm with Enter-button to make the partition existing at the end
Enter # Confirm with Enter-button for the default starting sector of your system memory
+10000M # This will create the partition size by counting 10GB starting at the memory sector you recently created
Enter # Confirm with Enter for default Linux partition-type (8300)

7. Formating of the partitions

As I mentioned above we have to set the BIOS partition to ef02 format. This could be done by

mkfs.fat -F 32 -n ef02 /dev/sdxy # In my case /dev/sda1

For our normal system partition we will use ext4 format and give it the label p_arch

mkfs.ext4 -L p_arch /dev/sdxY

8. Mount the partitions

Until now you prepared the installation environment on the running USB stick as well as your memory device.
Now it’s time to link your installation environment with your empty system. For this, we have to mount the p_arch labeled partition

mount -L p_arch \mnt

to the mount point of the installation environment (\mnt).

9. Install Arch on the mounted memory device

Since Arch is using the package manager (pacman) the installation uses pacstrap as the key command. For this, I tried the English guide

pacstrap /mnt base linux linux-firmware

proceeding with some problems. So I tried the german guide instead, using some additional packages

pacstrap /mnt base base-devel linux linux-firmware dhcpcd nano intel-ucode iwd

For sure the English version is more light than the german one. But be sure you install packages that enable the opportunity to get internet access after you log out from the installation environment since the iwctl-package is not present anymore after the installation. With dhcpcd you can set up a wired connection after the installation. In this aspect, you can add iwd for the wifi-connection options. You should append intel-ucode using Intel, and amd-ucode using AMD environment. By the way, nano is a light, and terminal-based text editor.

This step may take a while, but after this, your basic Arch is installed.

10. Settings after installation

First, we need to generate the fstab-data. This is necessary for starting your system because it needs to know where to find the system data.

genfstab -Lp /mnt > /mnt/etc/fstab

Now it’s time to say goodbye to the installation environment and use chroot to start acting on your recently installed system. This takes place at the mounting point. By the way - this is the point where you can come back if Arch is broken and you want to repair it. Just make a live boot by booting from the installation stick and pick Arch installation - don’t worry about deleting your system, due to partitioning is already finished.

arch-chroot /mnt

From now on there are several configurations you should make. I will explain these quick with some additional comments:

echo philippsArch > /etc/hostname # Give your system a name - e.g. philippsArch
echo LANG=de_DE.UTF-8 > /etc/locale.conf # Change language settings - e.g. german
nano /etc/locale.gen # Open and find your language setting and enable them by erase the `#` before each setting (for german with english backup: #de_DE.UTF-8 UTF-8, #de_DE ISO-8859-1, #de_DE@euro ISO-8859-15, #en_US.UTF-8)
locale-gen # Create the local.gen file 
echo KEYMAP=de-latin1 > /etc/vconsole.conf # Configurate keyboard layout 
echo FONT=lat9w-16 >> /etc/vconsole.conf # Configurate font type
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime # Configurate local time via time-zone
passwd # Define a root password

11. Install Grub (boot loader)

You first need to install Grub for BIOS via pacman

pacman -S grub

Pay attention if Arch is not the only system that should run on the system. You also need to configure Grub. Start with

grub-install /dev/sda

A popular mistake at this point is to add a partition number - e.g. /dev/sda1 - which leads to issues.
Don’t forget to generate the grub.cfg file or you may get stuck in a terminal-based Grub after booting your system. The file can be automatically built by

grub-mkconfig -o /boot/grub/grub.cfg

12. Finish and first boot

After you are finished you need to switch from your recently installed Arch system, back to the live (installation) environment of your USB stick by exiting the chroot environment:

exit

Make sure you unmount your Arch system from the installation environment

umount /mnt/boot

or

umount /mnt

depending on how and where you mounted at the beginning.

Lastly, make a reboot

reboot

and login to your Arch system.

13. Setting up a graphical user interface (GUI)

Using the terminal could be productive, light, and fast. But at least for using the browser a graphical user interface (GUI) is needed. For my system, I choose KDE Plasma.

Before one can install Plasma, the installation of the X window-system is needed. The basic packages can be installed with

pacman -S xorg-server xorg-xinit

In the next step information about the graphic card is needed. One can find the hardware information using

lspci |grep VGA

For the nVidia graphic card (nouveau) in my system, the driver installation looks like

pacman -S xf86-video-nouveau

X is also able to handle the keymap and the touchpad. To configure a german keymap hit

localectl set-x11-keymap de pc105 deadgraveacute

To enable the functionality of the touchpad use

pacman -S xf86-input-synaptics

After this work, a reboot is recommended

reboot

Now it’s time to go on with the installation of Plasma itself. For this the desktop plasma-desktop, the extention plasma, and the meta package plasma-meta is possible.

pacman -S plasma-desktop plasma plasma-meta

To further enable a GUI-supported login, a login manager is needed. First, install

pacman -S sddm sddm-kcm

and then activate it

systemctl enable sddm.service

After

reboot

your Arch should show up with a GUI.

14. User configurations

Lastly I

  • had to configure the system,
  • needed to fix problems with the wifi connection and
  • wanted to install some useful packages.

At this state of time, I like to add the information, that getting to the terminal after Plasma installation isn’t that straightforward one would think. For my system, I can change to the Arch console environment using CTRL + ALT + F3-buttons. As I remember this wasn’t possible for the first time. Some reboots fixed this issue. For this reason, remember to install a terminal you prefer.

To configure the system I ran severial commands.
First of all, I started by setting up a new user and giving it a password, since working on root is not recommended.

useradd -m -g users -s /bin/bash yourUserName

and

passwd yourUserName

To use sudo-rights add the user to the wheel-group.

gpasswd -a yourUserName wheel

Setting up a wifi connection right after the installation was not possible for me. To fix the wifi problem I connected to the internet in the use of a wired connection (LAN). First, you need to check the ethernet device with

ip link

and then set up the connection with

dhcpcd enp2s0

where enp2s0 is the ethernet device in my case. dhcpcd lets your router give a name (IP) to your system.

Although I tried to install iwd at an earlier point in time, I tried it again right after the above-mentioned packages and successfully set up a wifi connection.

pacman -S iwd

For working in the iwctl-environment you can check chapter three of the tutorial again. Also, give it a try after another reboot.
Lastly, an update of the system could help to fix the problem

pacman -Syu

Closing with the project I changed my mirror-list with some german mirrors in nano

nano /etc/pacman.d/mirrorlist

and installed some useful packages like

pacman -S vlc # VLC Mediaplayer

but also libreoffice, thunderbird, firefox, visual-studio-code-bin and konsole acting the same way.

Conclusion

In the end, I needed two days to get Arch running on my system due to the old hardware which made it a bit more complex. But now I can say I mastered Arch Linux and also improved the performance of my system. I used Ubuntu on this system before and record more speed and a doubled battery lifetime per load. So, after all, I can recommend this installation of Arch if you are interested in performing on Linux, get back control of your system, and improve the performance. If you have an old system that would be nice to rerun, this would be perfect to get in touch with Arch.


Sources

Links Latest Access
Arch Linux ISO 16.05.2021
Gdisk 16.05.2021
German Guide 16.05.2021
Grub 16.05.2021
Official Guide 16.05.2021

Attachments

Looking back to that point in time the installation of Arch was finished on my memory device, I started filling the Linux command history, which you can easily look up by entering

history

into your terminal.
Afterward, I did so too, added short comments after each command, and also the references of each topic. In the following I want to share this short and compact list of commands with you, so you can have a really quick overview of the installation. Just copy the needed line - the # makes the comments to be ignored in the terminal.
Click here to open.

Last updated on 3 May 2021
Published on 3 May 2021
 Edit on GitHub