APC Australia

Installing Arch Linux

-

Before you can do anything you’ll want to start the ISO downloadin­g for the Arch Linux install image. Head to www. archlinux.org/download and grab one of the torrents, or else scroll down to one of the localised mirrors.

Best practice is to run an integrity check on the download file – this ensures that it’s downloaded correctly but also that no one has interfered with the stored file. Technicall­y the ISO file and checksum hash should be stored on different systems, so it’s harder to compromise both.

The easiest way is to use a hasher, such as IgorWare Hasher (www.igorware.com/hasher) for Windows types, load the ISO file and click “Calculate.” The generated SHA-1 and MD5 hash should match that on the Arch Linux download page. You can copy and paste it to save you reading a long hexadecima­l number.

If you’re thinking of installing this onto a real PC then you’ll need to burn the ISO to a CD/ DVD (remember those things) or more likely use Etcher.io to write it to a USB stick. Reboot your system, and activate its boot menu via the correct function key, usually one of F2, F10, or F12 to boot your PC from the USB device.

We’re going to opt for the sensible angle of installing using a VirtualBox.org. Create a new 64-bit machine, ideally with 4GB of memory, but 2GB or even 1GB is fine. Set a hard drive of at least

20GB, ICH9 chipset, VMSVGA graphics, 3D accelerati­on won’t hurt. Point the optical drive at the Arch ISO image and fire it up.

At the Arch Grub – remember that? – boot menu choose the top option to kick off installati­on. Typically you’d first set your keyboard mapping so you can type in stuff – as it defaults to the US, we’re all good. If you need to, list the available keyboards (there are a lot, you probably want the / qwerty/ folder) with: ls /usr/share/kbd/ keymaps/**/*.map.gz | more

And activate the one you want with loadkeys for example: loadkeys uk

We should also check what type of firmware the PC is using, EFI or BIOS/CSM. To see if the EFI folder exists, type: ls /sys/firmware/ efi/efivars

If it does exist you’re on an EFI system, if not it’s the old BIOS. This changes the partition layout required. If you were expecting something different you’ll need to check your UEFI settings – for our VirtualBox it’s using the old BIOS by default. If you want, you can create VirtualBox machines running EFI. To run updates, the system will need an active network connection. For VirtualBox systems and most PCs with a wired Ethernet connection this’ll just be up and running, and the DHCP will be active. You can test it via: ip link and: ping archlinux.org

If you’re on actual real hardware with a wireless adaptor you’ll need to connect to a network. You should check to see if the hardware is recognised and working. If it’s not you’re a little bit stuck, as adding kernel modules is outside this tutorial, though it’s not hard: Discover the hardware manufactur­er and model, search for and download the kernel module (the driver), and add the module via modprobe .

An easy ways to check for an internal PCI adaptor is to use: lspci and look for a wireless network device. For USB dongles use: lsusb and do the same. Adding a wireless network is more involved: With the Inteldevel­oped configure tool, type: iwctl

This provides an interactiv­e prompt, type help at any point, use Tab to autocomple­te commands and station names. A basic session (ignore #comments) would go like: device list #lists compatible wireless devices station scan #scan for SSIDs on the selected device station get-networks #list detected SSIDs station connect #connect, you’ll be prompted for the passkey Exit #takes you back to the prompt At this point you’re good to prepare the main drive, create the partitions, and initialise the filesystem­s. BIOS and UEFI systems have two slightly different layouts: UEFI ones require a dedicated FAT32 partition for the second stage bootloader as the first partition, whereas BIOS just requires the root storage partition – often there’s a second for swap, but that’s growing out of fashion.

To list all attached block storage devices, type: lsblk Ignore “loop” and “rom,” we just want “disk” types. For our VirtualBox example and SATAbased PCs this device is sda; for NVMe and flash-storage devices this is nvme0n1 and mmcblk0 – yes, zero naming consistenc­y, welcome to Linux.

Similarly, using the old DOS partition tool fdisk, type fdisk -l for a bit more informatio­n. To kick things off, type the full path of the device you want to set up: fdisk /dev/sda

First, create your two new partitions in order: The small EFI one and the main Linux root. You can skip this first one for BIOS systems, but it’ll work either way. Tap n to create a new partition n , p for primary, Return for default, Return for default, and

+512M to make it 512MB in size. Tap t to change the type and select EFI for us this is type ef .

To create the main root partition, type n , default, default, default, default to use the whole remaining space. Type w to write these changes and exit. It’s now necessary to create the filesystem­s; the EFI one is FAT32 while the main one is the Linux native ext4 format. mkfs.fat -F32 /dev/sda1 mkfs.ext4 /dev/sad2

The partitions have been created, formatted, but Linux requires specific partitions to be mounted to make them accessible. For the EFI two partition setup this will be the /dev/sda2 partition. mount /dev/sda2 /mnt

Before you trigger the main install process, you need to ensure that the mirrors are the best available for our locality. You’re going to run a number of commands to prep the install for updates.

Pacman is the Arch Package Manager tool – you’ll use this a lot if you stick with Arch. First, synchronis­e the main repository ready for installing software, install a tool called reflector, and use it to ready a list of the 12 latest, fastest US mirrors. pacman -Syy pacman -S reflector reflector -c “US” -f 12 -l 10 -n 12 --save /etc/pacman.d/ mirrorlist

The majority of the packages can be installed via the pacstrap script. Leave this to download all the base files and get a cup of coffee. If it fails or stall you can simple re-run it: pacstrap /mnt base linux linux-firmware nano

At this point the base OS is installed, but you have to do some tedious but necessary housekeepi­ng. The first item is to store the partition mount configurat­ion in the Filesystem­Table, or fstab, so the OS knows what to mount at boot time. You’re currently still running off the ISO image, change root with chroot to your newly installed /mnt and then set the timezone settings. Choose a suitable timezone, or use the UTC. genfstab -U /mnt ≥≥ /mnt/etc/ fstab arch-chroot /mnt timedatect­l list-timezones timedatect­l set-timezone UTC

Another set of settings that is often taken for granted is the locale. This defines the language, number system, date format, and default currency. This is a little messy, but you need to first edit a large config file of possible locales. nano /etc/locale.gen Locate the line #en_US.UTF-8 UTF-8 and remove the # and press Ctrl-O (output) to save and Ctrl-X to exit. Then finish it off with: locale-gen echo LANG=en_US.UTF-8 ≥ / etc/locale.conf

Now to set the base local networking settings that are rarely considered. First, create a hostname for your system; the ”pcname” can be anything you like: Echo pcname ≥ /etc/hostname nano /etc/hosts

The last command fires up a text editor with a new hosts file, add to it these lines, and remember to change “pcname.” Press Ctrl-O to save (output) the file and then Ctrl-X to exit: 127.0.0.1 localhost

::1 localhost 127.0.1.1 pcname

Finally, initiate the network manage, and set a password for the base admin account – the username is root: systemctl enable NetworkMan­ager.service passwd

And finally (really this time), we have to install the Grub bootloader on our non-EFI system. It takes three commands: The first installs Grub itself, the next installs Grub onto the boot partition, and the final one creates the bootloader config file it’ll need when kicked into life. pacman -S grub grub-install /dev/sda grub-mkconfig -o /boot/grub/ grub.cf

If you were on an EFI system things would look similar but require extra steps to create the / boot/efi folder and mount the boot partition like this: pacman -S grub efibootmgr mkdir /boot/efi mount /dev/sda1 /boot/efi grub-install --target=x86_64efi --bootloader-id=GRUB --efi-directory=/boot/efi grub-mkconfig -o /boot/grub/ grub.cfg

At this point you could reboot – remember to remove the ISO image – and log into your Arch install. You’ll be left at a command prompt, but you have a Linux install that powers a good portion of the internet. However, as we’re here we might as well install the standard GUI called Gnome. We’d love to delve into just how mind-numbingly complex modern graphical interfaces are, but instead we’ll just let you gawp at the 2GB install triggered by these two commands: pacman -S xorg pacman -S gnome systemctl start gdm.service systemctl enable gdm.service exit shutdown now

Remove the USB stick or ISO image file, fire up your Arch install and log in as root using your password and welcome to Arch Linux using the base Gnome interface.

Hopefully you will now feel a little more enlightene­d about how PCs tick, and especially what’s required to get them to boot.

 ??  ?? The standard Gnome desktop.
The standard Gnome desktop.
 ??  ?? This is what most people think Linux looks like, they’re right!
This is what most people think Linux looks like, they’re right!

Newspapers in English

Newspapers from Australia