Installing Arch Linux. Step-by-step guide (with pictures). Installation and initial configuration of ArchLinux Creating a bootable USB flash drive

First we will install Archlinux and turn it into a boot server. Directly from there, we will prepare a new compact system, into which we will add a minimal graphical environment and the most necessary functionality (using Firefox as an example). Let's teach our system to boot over the network, even on computers with UEFI. Then we will completely switch it to read-only mode (make it “live”), which will allow us to use the system simultaneously on at least half a hundred different computers with one single boot server. All this will work even within a cheap 100 MB network, which we will additionally “overclock” a couple of times.

You won’t be afraid of any bookmarks in your hard drives, because we won’t have any hard drives. No crazy hands of users will break anything, because after a reboot the system will return to its original state by you personally. Of course, you will learn and be able to independently change the bootable system so that it contains only the functionality you need and nothing superfluous. In the meantime, we will find out how and in what order Linux boots, as well as what it consists of. Knowledge, as you know, is priceless, so I share it as a gift.

I will try to explain what is happening without much discussion, sometimes getting a little ahead of myself, but then be sure to put everything in order. So that you don’t have any problems with understanding at all, I assume that you have already worked with some ready-made Linux distribution, tried to write simple scripts using nano or another text editor. If you're new to ArchLinux, you'll learn a lot, and if you're new to ArchLinux, you'll learn less, but I hope you'll fall in love with Linux even more.

There was a lot of information. And according to the established Hollywood tradition, a series in several parts awaits you ahead:
continuation ;
ending .

Now we will install Archlinux in VirtualBox, which can be cloned and run on almost any computer with a legacy BIOS without any additional settings. In the meantime, we'll get acquainted with the basic techniques of working with systemd, and also learn how to use it to launch arbitrary services and programs at boot time. We will also see what stages Linux goes through when loading, and we will write our own handler (hook), which we will place in the initramfs. Don't know what initramfs is? Then go to cat.

There are many reasons why Archlinux was chosen. The first reason: he is my long-time quirky friend and faithful assistant. Gentoo, as they write on the Internet, is even more resourceful, but you don’t want to build a system from source code. The second reason: ready-made assemblies always contain a lot of unnecessary stuff, and pumping large amounts of data can critically affect network performance, and nothing is visible behind the wide back of the “automatic installer” - this is the third reason. Fourth: systemd is gradually penetrating all distributions and even Debian, so we can take a good look at the future of ready-made distributions using Archlinux as an example. With all this, the system that we will later prepare can be loaded over the network not only from a server running in a virtual machine, but also from a regular computer, for example, from a Raspberry Pi, and even from Western Digital My Cloud (verified), which works under Debian.

Preparatory work

Download the latest image from the link from the official website. In Moscow, for example, downloading from Yandex servers is very fast, and if the process takes a long time for you, just try downloading in another place. I recommend remembering which one, because this information will be useful to us later.

In VirtualBox we create a new virtual machine (for example, with 1 GB of RAM and 8 GB of storage). In the network settings, you must select the “network bridge” connection type and a suitable network adapter with Internet access. We connect the downloaded image to the CD-ROM. If you can’t wait to start working with hardware, then take a flash drive and burn the image using (if you are working under Windows), and then boot the future server directly from it.

We turn on the machine, wait for the command line to appear and set a password, without which SSH will not work:

Passwd
We start the SSH server with the command:

Systemctl start sshd
It remains to find out the IP address of the machine by examining the output of the command:

IP addr | grep "scope global"
The address will be indicated immediately after “inet”.

Now Windows users will be able to connect to the machine using putty and then copy and paste commands from here and right-click.

Basic installation

Next, I will describe the standard Archlinux installation as briefly as possible. If you have questions, you will probably find the answers to them in. The Wiki is great, and the English wiki is even up to date, so try to use that one.

We prepare the media using cfdisk (this is a console utility with a simple and intuitive interface). We only need one partition, just don’t forget to mark it as bootable:

Cfdisk /dev/sda
We format it in ext4 and set the label, for example HABR:

Mkfs.ext4 /dev/sda1 -L "HABR"
We mount the future root partition to /mnt:

Export root=/mnt mount /dev/sda1 $root
Archlinux is usually installed over the Internet, so immediately after installation you will have the latest and most up-to-date version. The list of repositories is in the /etc/pacman.d/mirrorlist file. Try to remember where you downloaded the distribution from and move these servers to the very beginning of the list - this way you will seriously save time on the next step. Typically these are servers geographically located in the same place where you are currently located.

Nano /etc/pacman.d/mirrorlist
Install a basic set of packages and a developer kit:

Pacstrap -i $root base base-devel
Now let's use the arch-chroot command, which allows you to temporarily replace the root directory with any other directory that has the structure of the Linux root file system. At the same time, the programs that we launch from there will not know that something else exists outside. We will practically find ourselves in our new system with administrator rights:

Arch-chroot $root
Notice how the command line prompt has changed.

We select the languages ​​we plan to use. I suggest leaving en_US.UTF-8 UTF-8 and ru_RU.UTF-8 UTF-8. In a text editor you just need to remove the comments next to them:

Nano /etc/locale.gen
Now we generate the selected localizations:

If everything went well, you will see something like this:

Generating locales... en_US.UTF-8... done ru_RU.UTF-8... done Generation complete.
Set the default language:

Echo LANG=ru_RU.UTF-8 > /etc/locale.conf
And also the layout and font in the console:

Echo -e "KEYMAP=ru\nFONT=cyr-sun16\nFONT_MAP=" > /etc/vconsole.conf

Specify the time zone (I use Moscow time):

Ln -s /usr/share/zoneinfo/Europe/Moscow /etc/localtime
Let's come up with a name for our future server:

Echo "HabraBoot" > /etc/hostname
Now let's set the administrator password. We do this primarily because SSH will not allow us to connect to the system without a password. We will not develop the topic of the unwiseness of using a system that is not password protected here.

Passwd
Enter the password twice and make sure that password updated successfully.

Let's add a new user with the name username(you can choose any), we will give it administrator rights and give it a password for the same reasons, and also due to the fact that as root in the current version of Arch we will not be able to collect packages from the AUR (Arch User Repository is a repository from the community Arch Linux users with programs that are not included in the main repository):

Useradd -m username
Edit the settings file /etc/sudoers using nano:

EDITOR=nano visudo
By adding another line to it immediately after the line “root ALL=(ALL) ALL”:

Username ALL=(ALL) ALL
And set the password for the user username:

Passwd username
Now you need to install the bootloader on the internal drive so that the system can boot from it on its own. I suggest using GRUB as a bootloader, because we will need it again later. We install packages using the standard Archlinux package manager pacman:

Pacman -S grub
We record the bootloader in the MBR (Master Boot Record) of our internal drive.

Grub-install --target=i386-pc --force --recheck /dev/sda
If everything went well, you will see Installation finished. No error reported.

Exit chroot:

Exit
And we notice how the command line prompt has changed.

We will use disk labels, a detailed explanation of this statement will follow later.

Uncomment the line GRUB_DISABLE_LINUX_UUID=true to avoid using drive UUIDs:

Nano $root/etc/default/grub
We generate the bootloader configuration file, again using arch-chroot. You will be logged in, execute one single command, and automatically log out:

Arch-chroot $root grub-mkconfig --output=/boot/grub/grub.cfg
We need to replace all references /dev/sda1 on LABEL=HABR in the configuration file:

Mv $root/boot/grub/grub.cfg $root/boot/grub/grub.cfg.autoconf && cat $root/boot/grub/grub.cfg.autoconf | sed "s/\(root=\)\/dev\/sda1/\1LABEL=HABR/g" > $root/boot/grub/grub.cfg
If you change the line in the same file set lang=en_US on set lang=ru_RU, then the bootloader will communicate with us on the great and mighty.

We generate an fstab file with the -L switch, which will force the generator to use disk labels:

Genfstab -p -L $root > $root/etc/fstab
This completes the basic installation of ArchLinux. The system will boot on its own and will greet you with a friendly Russian-language command line interface. If after this we enter the dhcpcd command, then most likely even the Internet will work. But we won’t rush into a reboot just yet.

Startup at boot using systemd using NTP and SSH as an example

Since our system will communicate with other computers, we will need to synchronize the time. If the time on the server and client is different, then there is a high probability that they will not be able to connect to each other at all. In turn, sudo may start asking for a password after each action, thinking that the authorization timeout has long expired. And who knows what we still have to face? Let's play it safe.

To synchronize time with servers over the Internet using the NTP protocol, we need to install the missing packages. You can use arch-root, but we will make do with the keys that will tell the package manager the new installation location:

Pacman --root $root --dbpath $root/var/lib/pacman -S ntp
Let's set up receiving exact time from Russian servers:

Mv $root/etc/ntp.conf $root/etc/ntp.conf.old && cat $root/etc/ntp.conf.old | sed "s/\(\).*\(.pool.ntp.org\)/\1.ru\2/g" | tee $root/etc/ntp.conf

We only need to synchronize the time once upon boot. Previously, we would have recorded the launch of the time service in the rc.local file, but now the system and service manager systemd has appeared, which tries to launch services (in the original they are called units) in parallel to reduce system boot time. Naturally, the performance of one service may depend on the functioning of another. For example, it is useless for us to try to synchronize time over the Internet before we have a network working on our computer. To describe all these relationships, simply specifying the name of the executable file is no longer enough, so launching through systemd has become a very non-trivial task. For this purpose, special files with the extension ".service" were created. They indicate dependencies, executable file names, and other parameters that must be taken into account for a successful launch. In particular, to manage boot stages, systemd uses targets, which are similar to runlevels in terms of the tasks assigned to them. Read more on the wiki.

To the delight of beginners, a ready-made ntpdate.service is supplied with the ntp package. All files that describe starting services are located in the $root/usr/lib/systemd/system/ folder, and they can be opened in any text editor or viewed in the usual way. For example, $root/usr/lib/systemd/system/ntpdate.service:

Description=One-Shot Network Time Service After=network.target nss-lookup.target Before=ntpd.service Type=oneshot PrivateTmp=true ExecStart=/usr/bin/ntpd -q -n -g -u ntp:ntp WantedBy= multi-user.target
In the block in the Description line, a brief description of the service is indicated, and under what conditions it should be launched (in this case, after starting the network, but before starting the NTP server, which we do not plan to start at all). The exact time request occurs only once during loading, and this is the responsibility of the Type=oneshot line from the block. In the same block, the ExecStart line indicates the actions that must be performed to start the service. The block in our case states that running our service is necessary to achieve the multi-user.target. It is recommended to use the same block content to run homemade services.

As a first practical example, we will slightly extend the functionality of ntpdate.service by asking it to additionally correct the time on the hardware clock. If after this, on the same computer you boot into Windows, you will see the time in Greenwich Mean Time, so don’t be alarmed.

Changing the standard behavior of any systemd service is done as follows: first, in the /etc/systemd/system/ folder, a new directory is created with the full name of the service and the ".d" extension, where a file with an arbitrary name and the ".conf" extension is added, and there necessary modifications are made. Let's get started:

Mkdir -p $root/etc/systemd/system/ntpdate.service.d && echo -e "\nExecStart=/usr/bin/hwclock -w" > $root/etc/systemd/system/ntpdate.service.d/ hwclock.conf
It simply says that immediately after starting the service, run the command “/usr/bin/hwclock -w”, which will change the hardware clock.

Add the ntpdate service to startup (the syntax is standard for all services):

Arch-chroot $root systemctl enable ntpdate Created symlink from /etc/systemd/system/multi-user.target.wants/ntpdate.service to /usr/lib/systemd/system/ntpdate.service.
As you can see, an ordinary symbolic link to the ntpdate.service file was created in the multi-user.target.wants directory, and we saw a mention of the multi-user.target target in a block of this very file. It turns out that in order for the system to achieve the multi-user.target goal, all services from the multi-user.target.wants directory must be started.

Now install the SSH package in a similar way (in ArchLinux it is called openssh):

Pacman --root $root --dbpath $root/var/lib/pacman -S openssh
But this time we will use a socket for autostart so that the SSH server starts only after a connection request is received, and does not hang as a dead weight in RAM:

Arch-chroot $root systemctl enable sshd.socket
We did not change the standard 22nd port and did not enable the forced use of Protocol 2 - let this remain on my conscience.

Looking ahead or getting acquainted with handlers (hooks)

So that we can connect to our future server without looking, we need to know its IP address. It will be much easier if this address is static. The usual methods mentioned in the wiki do not work for us. The problem is that network adapters in the modern world are named according to their physical location on the motherboard. For example, the device name enp0s3 means that this is an ethernet network adapter, which is located on PCI bus zero in the third slot (details). This is done so that when replacing one adapter with another, the name of the device in the system does not change. This behavior is not desirable for us, because on different models of motherboards the position of the network card may be different, and when we try to transfer our boot server from VirtualBox to real hardware, we will most likely have to boot with a keyboard and monitor in order to configure the network correctly . We want the network adapter name to be more predictable, such as eth0 (this space is reserved by a smiley).

Why are we going to do this?

I'm sure there are more elegant solutions to the device naming problem, but the following was a good way to demonstrate the general principle of booting Linux. Please do not forget to introduce the methods you have tested to the community in the comments.


We install the mkinitcpio-nfs-utils package, and we will have a handler (hook) called “net”:

Pacman --root $root --dbpath $root/var/lib/pacman -S mkinitcpio-nfs-utils

By default, all handler files end up in /usr/lib/initcpio/. Usually these are paired files with the same name, one of which will be in the install subdirectory, and the other in hooks. The files themselves are ordinary scripts. The file from the hooks folder usually ends up inside the initramfs file (we'll learn more about it later) and is executed when the system boots. The second file of the pair goes into the install folder. Inside it there is a build() function, which contains information about what actions need to be performed during the generation of the initramfs file, as well as a help() function with a description of what this handler is intended for. If you are confused, then just read on, and everything said in this paragraph will fall into place.

The initcpio folder is also present in the /etc directory, and it also has install and hooks subdirectories. At the same time, it has unconditional priority over /usr/lib/initcpio, i.e. if there are files with the same names in both folders, then when generating initcpio, files from /etc/initcpio will be used, and not from /usr/lib/initcpio .

We need to change the functionality of the net handler a little, so we'll just copy the files from /usr/lib/initcpio to /etc/initcpio:

Cp $root/usr/lib/initcpio/hooks/net $root/etc/initcpio/hooks/ && cp $root/usr/lib/initcpio/install/net $root/etc/initcpio/install/
We bring the hooks/net file to the following form:

Cat $root/etc/initcpio/hooks/net # vim: set ft=sh: run_hook() ( if [ -n "$ip" ] then ipconfig "ip=$(ip)" fi ) # vim: set ft= sh ts=4 sw=4 et:

Now let’s open the file $root/etc/initcpio/install/net and see that the help() function perfectly describes what the “ip” variable should be:
ip= ::::::
All that remains is to simply set the value of the variable to set the static IP address and name of the network device, for example “192.168.1.100::192.168.1.1:255.255.255.0::eth0:none” (hereinafter, use the network settings that suit you). In the next section you will learn where exactly the value is set.

In the meantime, let's remove everything unnecessary from the file $root/etc/initcpio/install/net. We leave the loading of network device modules, the ipconfig program that we used above, and, naturally, the script itself from the hooks folder, which does all the main work. You'll get something like this:

Cat $root/etc/initcpio/install/net #!/bin/bash build() ( add_checked_modules "/drivers/net/" add_binary "/usr/lib/initcpio/ipconfig" "/bin/ipconfig" add_runscript ) help( ) ( cat<When, during boot, the systemd-udevd device manager tries to rename our network device to its usual predictable network interface name, for example, enp0s3, it will not work. Why - read on.

How the system boots

For simplicity, let's look at regular BIOSes. After turning on and initializing, the BIOS begins to move through the list of boot devices in order until it finds a bootloader to which it will transfer further boot control.

We recorded just such a bootloader in the MBR of our drive. We used GRUB, in the settings of which (the grub.cfg file) we indicated that the root partition was located on a disk labeled HABR. Here is the entire line:

Linux /boot/vmlinuz-linux root=LABEL=HABR rw quiet
The file mentioned here is vmlinuz-linux, which is the kernel of the system, and the pointer to the root system is its parameter. We ask that you look for the root system on a device labeled HABR. There could also be a unique UUID for each drive, but in this case, when moving the system to another drive, we would undoubtedly have to change it. If we had specified the location of the root system in the usual way for Linux users: /dev/sda1, we would not have been able to boot from a USB drive, since the USB drive would only receive this name if it was the only drive in the computer. It is unlikely that there will be another drive with the HABR label in your computer, but you should not forget about it.

Here we set the value of the global variable “ip” for our “net” handler (don’t forget to change the addresses to those used in your network):

Linux /boot/vmlinuz-linux root=LABEL=HABR rw quiet ip=192.168.1.100::192.168.1.1:255.255.255.0::eth0:none

In the next line there is a mention of the initramfs file, which I promised to look into:

The name initramfs comes from initial ram file system. This is actually a regular Linux root filesystem packaged in an archive. It is deployed in RAM at boot time and is designed to find and prepare the root file system of our Linux that we are ultimately trying to boot. Initramfs has everything you need for these purposes, because it is a real “little Linux” that can execute many common commands. Its capabilities are expanded with the help of hooks, which help form a new root file system for our Linux.

After the programs in the initramfs have completed their work, control of further loading is transferred to the init process of the prepared root filesystem. Archlinux uses systemd as its init process.

The systemd-udevd device manager is part of systemd. He, like his older brother, tries to detect and configure all devices in the system in parallel. It starts its work one of the first, but after our net handler initializes the network card at the initramfs stage. Thus, systemd-udevd cannot rename the device in use, and the name eth0 remains with the network card for the entire time it is running.

Be sure to remove the autodetect handler. It checks the devices installed on this particular computer, and leaves only the modules necessary for them in the initramfs. We do not need this, since we are initially considering the possibility of further transferring the system to another computer, which will most likely differ in hardware from the virtual machine used.

A list of handlers sufficient for our purposes, including the net we created, looks like this:
HOOKS="base udev net block filesystems"
insert this line into the mkinitcpio.conf file, and comment out the old one:
nano $root/etc/mkinitcpio.conf

Based on the standard linux preset, we create our own habr preset:

Cp $root/etc/mkinitcpio.d/linux.preset $root/etc/mkinitcpio.d/habr.preset

And we bring it to this form:
cat $root/etc/mkinitcpio.d/habr.preset ALL_config="/etc/mkinitcpio.conf" ALL_kver="/boot/vmlinuz-linux" PRESETS=("default") default_image="/boot/initramfs-linux. img"

We don't need a "fallback" branch that removes autodetect from handlers, because we've already removed it ourselves, and we don't need to generate the same initramfs file twice with different names.

We generate a new initramfs using the habr preset:

Arch-chroot $root mkinitcpio -p habr

Writing a DNS update service for use with systemd

Our network card receives all the settings so that the network and Internet work. But site names will not be translated into IP addresses, since our system does not know which DNS servers should be used for this. Let's write our own service for these purposes, which systemd will launch upon boot. And in order to learn something new and not get bored from the monotony, we will pass information about the name of the network device as a parameter, and save the list of DNS servers in an external file.

Resolvconf is responsible for updating information about DNS servers. The syntax is ideal for us:

Resolvconf [-m metric] [-p] -a interface In the file imported here, the IP address of each server is listed on a new line after the nameserver keyword. You can specify as many servers as you like, but only the first 3 of them will be used. As an example, we will use Yandex servers. In this case, the file passed to resolvconf should look like this:

Nameserver 77.88.8.8 nameserver 77.88.8.1
We need to obtain information about DNS servers before the system is sure that the network is fully operational, i.e. before the network.target is reached. We will assume that it is enough for us to update information about servers once during loading. And as standard, we’ll say that our service is required by the multi-user.target target. Create a service startup file in the directory with the following content:

Cat $root/etc/systemd/system/ [email protected] Description=Manual resolvconf update (%i) Before=network.target Type=oneshot EnvironmentFile=/etc/default/dns@%i ExecStart=/usr/bin/sh -c "echo -e "nameserver $(DNS0)\nnameserver $(DNS1)" | resolvconf -a %i" WantedBy=multi-user.target
In the ExecStart line we execute the echo command, which on the fly generates a file with a list of servers, which we pass through the resolvconf pipeline. In general, you can't use multiple commands on the ExecStart line, much less use pipelines, but we fooled everyone again by passing these commands as the -c parameter to /usr/bin/sh.

Please note that in the file name [email protected] the @ symbol is used, after which you can specify a variable, and it will go inside the file, replacing "%i". Thus, the line EnvironmentFile=/etc/default/dns@%i will turn into EnvironmentFile=/etc/default/dns@eth0 - this is the name of the external file we will use to store the values ​​of the DNS0 and DNS1 variables. The syntax is the same as in regular scripts: “variable name=variable value.” Let's create a file:

Nano $root/etc/default/dns@eth0
And add the following lines:

DNS0=77.88.8.8 DNS1=77.88.8.1

Now we add the service to startup, not forgetting to indicate the name of the network card after @:

Arch-chroot $root systemctl enable [email protected]
We have just written a universal file that allows the service to start. The versatility lies in the fact that if there are several network adapters in our system, then for each of them we can specify our own DNS servers. You just need to prepare a set of files with a list of servers for each device and start the service for each adapter separately, indicating its name after @.

Before the first launch

This completes the initial setup. We need to boot the installed ArchLinux from the internal drive for the changes we made to take effect.

Disable the finished root system:

Umount $root
And turn off the virtual machine:
initramfs Add tags

I recently switched to Arch, and am more than completely satisfied with this system. For those who are just deciding whether to install Arch Linux on their computer, first I’ll explain what awaits them when switching from other systems. Unlike Ubuntu, Arch does not have such a rich content of “vital” programs that the average user not only does not use, but is not even aware of their existence in the system, and most importantly, their purpose. Here the user is given the right to choose what to install and what not.

Accordingly, in the finished system there will be nothing superfluous, only what the user himself wants. If you are used to fonts in Ubuntu, then in any other distribution you will have to tinker with them a little, and Arch is no exception. Compared to Gentoo, it lacks the ability to use USE flags, but many are not disappointed at all, and as for the installation time...

In order to dispel the myth about the complexity and duration of installing Arch Linux, I’ll say right away that installation for the first time can take from one and a half to two to three hours if you install according to the manual, being aware of each command. Basically, it takes up to 20 minutes to install the system itself (bare), after which the necessary environment (DE) and drivers for the video card are installed (all this is about an hour), and you can start customizing the appearance of the system, goodies, installing additional software and etc. The latter may take more than one day for a beginner, however, the system will already be working at that time.

Updates in Arch appear, if not on the same day, then the next. This has both its pros and cons: always fresh software does not mean always stable. However, I have never been able to “downgrade” the system with updates.

Here, in principle, is a short preface for those who are still thinking. And for those who have already decided to install Arch Linux, let's get started;)

Preparing for installation

To install, we will need the Arch Linux installation image. You can download it from the corresponding page of the official website. I will not explain which image to download, as well as how and what to record it on, because if you decide to install this distribution, then you should already have the relevant knowledge. Personally, I chose the "Core Image" and burned it to a flash drive using dd.

Not everyone can handle the disk partitioning program built into the installer, so I advise you to prepare partitions for the system in advance, as has already been described in how to do this. Typically, partitions are allocated under the root /, swap, and optionally under /home. The rest is rarely separated into separate batches.

We have the installation image recorded, the hard drive for installing the system is ready, let's move on to directly downloading and installing Arch Linux.

Boot from installation image

Having booted from a disk (flash drive), the first thing we will see is a boot selection window.

Select "Boot Arch Linux", wait for the image to finish loading and the login prompt to appear. Enter the root login and enter the command to call the installer

/arch/setup

We answer “OK” to the installer’s greeting and see the installer’s main menu, consisting of 8 items: Select Source(select installation source), Set Clock(time settings), Prepare Hard Disk(s)(hard disk preparation), Select Packages(select packages to install), Install Packages(installation of selected packages), Configure System(system configuration), Install Bootloader(bootloader installation), Exit Install(exits the installer).

Let's move on to the first point, select the installation source: for CD/DVD or flash - this is the first option (cd), for installation over a network - the second (net). To the warning that you can manually connect third-party sources, answer “OK”. In the second paragraph, we set up the area and time zone, set the time and return to the menu; I will not describe this point in detail.

The next step is to prepare the hard drive for installing the system. Since we have already prepared all the partitions in advance, we immediately select the third option to create mount points

Since I’m installing the system on a virtual machine, in the example I have only one partition, which I allocate under the root (/), but you may have more partitions. Select the desired partition and assign it the appropriate file system, as well as a mount point

The parameters shown in the next two pictures can be left blank

Before returning to the main menu, a warning may appear that we have not specified all partitions: the installer prompts us to select /boot as a separate partition, and also create swap. If we don’t want to do this, just ignore the warning and move on.

We have come to the selection of packages to install. The installer immediately informs us that the packages are divided into 2 parts: base and base-devel. If we don’t want to deal with each package separately, just go to base and use a space to select each package for installation.

After selecting the packages, we are prompted to install them, select the appropriate item in the menu. The process is not quick, as the installer immediately warns you about. Be patient and wait until the packages are installed; you don’t need to click anything.

After installing the packages, click “Continue” and move on to the most scary stage for beginners - system configuration. To edit files, it is best to choose nano, unless, of course, you are more familiar with any other editor.

Setting up configuration files

The most important configuration file is probably the /etc/rc.conf file, so let's start with it. The first parameter we need to specify is LOCALE. We need the ru_RU.UTF-8 locale. To do this, go to another virtual console (ALT+F2), log in as root, execute the command

Locale -a

There is no locale we need, we need to create it

Nano /etc/locale.gen

In this file you need to uncomment (remove #) the line ru_RU.UTF-8 UTF-8 and resave the file (Ctrl+O, Enter, Ctrl+X). Now let's generate locales and run the command

Locale-gen

We should see our locale in the list of generated ones. Now go back to the rc.conf configuration (Alt+F1), and enter the value ru_RU.UTF-8 in LOCALE.
HARDWARECLOCK - we already set the time during installation, and here, if Windows is installed on the second system, we set localtime. Otherwise - UTC.
TIMEZONE - should already be set (Europe/Moscow), since we have already configured the time zone.
KEYMAP - write ru.
CONSOLEFONT - font in the console, write cyr-sun16 to support the Cyrillic alphabet.
CONSOLEMAP - leave the field empty.
USECOLOR - use color in the console. The default is yes , we can’t change it.

MOD_AUTOLOAD - leave yes so that the necessary modules are automatically checked and loaded.
MODULES - modules to be loaded are indicated here. For now we leave it empty, this parameter will be filled in while using the system (installing programs and modules).
USELVM - leave it as default.

HOSTNAME - enter any host name here (for example, website).
eth0 - Default - dhcp. If we use a static IP address, comment out the line with “dhcp” and uncomment the line with the address like eth0="eth0 192.168.0.5 netmask 255.255.255.0 broadcast 192.168.1.255. In this case, our IP is 192.168.0.5.
INTERFACES - enter here, separated by a space, all network interfaces (or those that we want to use). You can find them out using the ifconfig -a command (in the adjacent virtual console).
gateway - if we use a static IP - set the gateway address (for example, the address of our ADSL modem).
ROUTES - remove the exclamation mark if we use a static IP.

DAEMONS - leave it as is for now. These daemons will be loaded when the system starts (if you put an “@” sign in front of the daemon, it will load in the background; if there is a “!” sign, then the daemon will not be loaded).

Here's an example of what you should end up with:

LOCALE="ru_RU.UTF-8"
HARDWARECLOCK="localtime"
TIMEZONE="Europe/Moscow"
KEYMAP="en"
CONSOLEFONT="cyr-sun16"
CONSOLEMAP=
USECOLOR="yes"

MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=()
USELVM="no"

HOSTNAME="site"

eth0="dhcp"
INTERFACES=(eth0)

gateway="default gw 192.168.0.1"
ROUTES=(!gateway)

DAEMONS=(syslog-ng network netfs crond)

Save the changes (Ctrl+O) and exit (Ctrl+X).

/etc/fstab
The file contains information about disks (partitions), cd/dvd, floppy, etc.
For now you can leave it unchanged.

/etc/mkinitcpio.conf
File for fine-tuning the initial file system. Let's leave it as is.
/etc/modprobe.d/modprobe.conf
Tells the kernel what modules will be loaded for devices and what options will be set. For now we leave it unchanged.

/etc/resolv.conf
Needs editing only if a static IP is used. Here you should enter the DNS servers that are used. If you are using a router (or an adsl modem) where the DNS servers are already specified, enter the IP of the router here (which was specified in rc.conf). Example:

#Router IP
nameserver 192.168.0.1
#DNS
nameserver 212.96.96.38
nameserver 212.96.104.129

/etc/hosts
Creates a correspondence between the IP address, name and alias of a host. We leave it unchanged.

/etc/hosts.allow And /etc/hosts/deny
If you do not plan to have an ssh daemon, leave it unchanged.

/etc/locale.gen
We have already dealt with locales by editing rc.conf.

/etc/pacman.conf
pacman package manager configuration file. You may want to uncomment the repository or add other repositories.
Here's a small example (last REPOSITORIES section):

# Uncomment to be able to get packages from testing
# repository
#
#



Include = /etc/pacman.d/mirrorlist


# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist


# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/mirrorlist
# Include = /etc/pacman.d/community

/etc/pacman.d/mirrorlist
List of package manager mirrors. Here's an example:

#Russia
Server = ftp://mirror.yandex.ru/archlinux/$repo/os/i686
Server = http://mirror.yandex.ru/archlinux/$repo/os/i686
Server = http://archlinux.freeside.ru/$repo/os/i686
Server = ftp://mirror.svk.su/archlinux/$repo/os/i686
Server = http://mirror.svk.ru/archlinux/$repo/os/i686
#
Server = http://repo.archlinux.fr/i686
Server = ftp://ftp.archlinux.org/community/os/i686

At this point, setting up the configuration files is complete, be sure to set the Root-Password, and exit by clicking “Done” at the end of the list. We are waiting for the configurator to finish working and proceed to installing the bootloader.

We are offered to either install GRUB or not install the bootloader at all. Naturally, we will install it, select the appropriate menu item. Now we are asked to check the bootloader configuration file and, if necessary, correct it. You can leave everything as it is, and if you are using a second Windows system, then you can simply uncomment the last lines in the file:

title Windows
rootnoverify(hd0,0)
makeactive
chainloader +1

We will deal with the choice of colors for display and delay timeout later, if necessary, now this is not important. Save the changes, exit the editor, select installing the bootloader in /dev/sda. We wait for a message about the successful installation of the bootloader, complete the system installation by selecting “Exit Install” in the main menu, write reboot in the console. That's it, the system is installed, but for now it is “bare”, there are no users, no drivers, no graphical shell.

First try

We reboot, remove the disk (flash drive), load the already installed system from the hard drive. The system requires you to introduce yourself, enter the root login and password we set during installation.

Now let's do a full system update:

Pacman-Syu

If the update is not completed, dig towards /etc/pacman.d/mirrorlist, most likely, you forgot to uncomment the mirrors from the Any and Russian sections. If the update has started, most likely you will need to first update the pacman package manager, which the system itself will ask you to do.

Since a new version of pacman was recently released, now you need to convert the database with the command

Pacman-db-upgrade

We launch the system update again, agreeing to the installation and replacement of packages

Pacman-Syu

The update has been completed, now it would be nice to create a separate user, it’s not possible to work under root. We write

Adduser

The system will ask for a login for the new user, so set it.
User ID - skip, the ID will be assigned automatically.
Initial group - the main group of the user, leave users.
Additional groups - additional groups for the user. audio - if we use a sound system; storage - management of flash drives, etc.; video - for video and 3d; wheel - use sudo; lp - print management. We write: audio, storage, video, wheel, lp.
Home directory - home directory, leave it as default (=username).
Shell - command shell, leave bash.
Expire date - the date until which the user will be active. Leave it blank.
Press Enter - the account has been created.

Setting up "X's"

Now let's configure the Xs, install xorg and the mesa package:

pacman -Sy xorg
pacman -S mesa

Next, you need to install drivers for the video card. Here you will have to resort to Google, because it makes no sense to describe it here for each video card. Later, perhaps, I will write separate articles on installing various drivers.

After installing the video card driver, run

Xorg-configure

Let's move on to editing xorg.conf (as root):

Nano /root/xorg.conf.new

We check whether the video card driver is detected correctly. I give an example of my xorg.conf (no need to copy it! It’s not a fact that you have the same hardware).
If everything is OK, copy your xorg.conf to the working directory:

Cp /root/xorg.conf.new /etc/X11/xorg.conf

DE installation

Here I will give examples of installing GNOME and XFCE (use it to your taste).

To install GNOME we write

pacman -S gnome
pacman -S gnome-extra

To install XFCE we write

Pacman -S xfce4 xfce4-goodies dbus gnome-icon-theme

Launch the necessary daemons

/etc/rc.d/hal start
/etc/rc.d/fam start

Let's add them to the DAEMONS section in /etc/rc.conf. Example: DAEMONS=(@syslog-ng @network hal fam @netfs @crond alsa)

Su username

Create a .xinitrc file to launch DE

Nano ~/.xinitrc

We fit it into it (for GNOME)

Exec ck-launch-session gnome-session

or (for XFCE)

Exec startxfce4

After this you can run "X"

System Setup

For convenience, we’ll immediately install yaourt to work with the custom AUR repository. Let's connect the repository containing yaourt. Opening

Nano /etc/pacman.conf

add to the end (for x86)


Server = http://repo.archlinux.fr/i686
or (for x86_64)


Server = http://repo.archlinux.fr/x86_64

and install the package itself

Pacman -Sy yaourt

To adjust the sound set

Pacman -S alsa-utils

configure by running as root

Alsamixer

We save the mixer settings with the command

Alsactl store

I won’t talk about installing various display managers in this article, but you can choose what to install: gdm, xdm, kdm, slim, etc.

That's basically it. We have an almost bare system installed. What to make of it next is up to you, I just tried to describe the process of installation and initial setup of the system. It turned out not as short as I planned, but believe me, installing Arch is much easier than it seems at first glance. If you have any questions, ask them in the comments to the article, and we’ll try to figure it out together.

Today, operating systems of the Windows family occupy a leading position in the market. However, in some cases it becomes necessary to use third-party free software due to personal preference or the inability to purchase a license for the Windows operating system. Linux operating systems come to the rescue in this case. However, not all of these systems are distinguished by the availability of accessible documentation and a friendly interface. As a rule, descriptions of such systems are available only in English, and not everyone today can boast of knowing it. But unlike closed-source operating systems, Linux systems have the ability to be more widely customized for a specific user. This article will talk in detail about the features of installing the ArchLinux system, as well as provide general information about this system as a whole.

ArchLinux: configuration and installation

There is one very interesting operating system in the Linux OS family called ArchLinux. The peculiarity of this operating system is that, unlike packaged “ubuntu-like” operating systems, the user can customize ArchLinux completely and completely. True, such setup requires certain knowledge, which often discourages beginners from using this system. In general, this system is designed for experienced users of Linux systems who can work with the terminal and command line. This is how it differs from packaged distributions. In many ways, setting up and installing ArchLinux differs from the installation process of other operating systems. This article will discuss in detail all the stages of installing the ArchLinux operating system.

ArchLinux: general information

The ArchLinux operating system is a kind of offshoot of the minimalistic CRUX system. This OS was popular among those who liked to assemble an operating system from source code and “tailor” it to their requirements as much as possible. Unlike its parent operating system, ArchLinux does not require the user to be able to build dependencies and compile kernels. You can install it using a regular graphical manager. The ArchLinux installation process begins using the command line.

This will be discussed later. At the moment, there are only two branches of development of the ArchLinux operating system. These are Current and Stable. The Stable operating system uses a stable version of the operating system with proven software. However, updates for such a system will have to wait a very long time. For lovers of constant updates and the latest software, there is a Current branch. In such a system, updates occur regularly, but this affects the stability of the system. Also, installing programs on such systems can cause errors and certain difficulties. Experienced ArchLinux users recommend using the Stable version. It may not be entirely relevant, but stability is more important.

A significant drawback of the ArchLinux operating system is the lack of installation documentation in the distribution itself. There are only general recommendations that are intended for advanced users of Linux operating systems. But they are all given in English. However, translations made by enthusiasts can be found on the Internet. Thus, for beginners, installing the ArchLinux operating system can be a very difficult task. Let's look at this complex process in more detail.

ArchLinux: preparing for installation

First of all, you need to create a bootable USB drive with a distribution of the ArchLinux operating system. To do this, you need to download an ISO image of the operating system from the official website of the project. The ArchLinux operating system image can be of two types: basic and full. The only difference is the size of the image and the number of available programs. The full version of the image weighs approximately 600 MB. The basic set weighs approximately 200 MB. It is better to give preference to the full version of the installation disk. After downloading, you need to select a program to burn the distribution onto a USB drive. If you use the Windows operating system, it would be better to use the Rufus program for this purpose. You can download this program completely free of charge. It doesn't require installation. Launch Rufus and select the downloaded disk image with the operating system. After that, click on the “Start” button. The USB drive will be formatted and renamed to ArchLinux during the recording process. In principle, this completes the installation on the flash drive. You can now reboot and try to install the operating system on your computer.

Running the installer

After completing all the manipulations related to the BIOS boot order, we begin loading the ArchLinux operating system from the flash drive. As mentioned above, in many ways the step-by-step installation of ArchLinux is very different from the same process for packaged operating systems. It is important to take into account all the features and details. The first thing that catches your eye is the command line. In order to launch the graphical installer, you must enter the command $/arch/setup. The installer window should then appear. Here are all the menu items that reflect the stages of the installation process: disk preparation, package selection, package installation, kernel installation, system configuration, bootloader installation, exit. If a beginner can easily cope with most sections of the menu, then the “Installing the kernel” item will have to work hard. It is for this reason that installing the ArchLinux operating system is considered a difficult process.

Preparing the Disk

The disk partitioning process for installing ArchLinux is slightly different from the requirements for other packaged operating systems in the Linux family. The easiest way would be to let the system divide the disk into partitions on its own. In this case, automation knows better what the system needs. If the necessary files are present on the hard drive, then you need to do manual partitioning so as not to lose them. It is with this procedure that the installation of ArchLinux begins. In case of manual partitioning of disks, you need to create the following partitions: root partition with label /; partition /usr; section /opt; section /var; section /var/abs; section /var/cache/pkg; section /var/cache/src; "/home" section. Let's look at what each of these sections is for. The root partition must be at least 1 GB. It is in this partition that the ArchiLinux operating system is installed. The /usr partition is the so-called “swap”.

It acts as a swap file to improve system performance. In terms of volume, it should be equal to the size of the installed RAM, multiplied by two. The /opt partition is used to place large files such as QT libraries, Xs and other files of the operating system working shell. The size of this partition should be approximately 4 GB. Partitions marked /var are used to accommodate various types of system information in order to eliminate the possibility of cluttering the root partition. The /home partition is used to store the user's personal data. For all partitions, the preferred file system form is ext3.

System installation

Installation of the ArchLinux operating system occurs in several stages. At the first stage, packages are selected and configured. If you do not know which of these items should be checked specifically for your computer, then simply leave the default values. The program, after analyzing the hardware, will decide what is needed and what is not. During the installation of packages, the boot loader will be installed. On ArchLinux, the default boot loader is GRUB. The next step is to install the system kernel. In this case, it would be better to rely on automatic selection and configuration of parameters. The only thing that the user will need to independently note is the type of kernel for the components of your computer.

If you are using a computer that supports SCSI technology, then you need to select this type. When the kernel installation is successfully completed, it is time to configure the operating system. In this case, you are asked to configure the system by editing text configuration files. However, it is better not to do this, as this may cause the system to freeze during the installation process. The most acceptable option would be to configure ArchLinux after installation. Using a graphical environment will make everything much easier.

Setting up ArchLinux

After performing a system reboot, the user needs to define some basic parameters. For ArchLinux, KDE is the preferred desktop environment. This is the one you should choose. At the command line, type the command pacman -S KDE. When the graphical shell loads, system setup will be faster. Now you need to install some internet browser to get more detailed information about setting up ArchiLunux after installation. To do this, you need to run the command pacman – S firefox. Here, using Google, you can find all the information you are interested in.


To begin with, I would like to answer the standard question of all those who have never encountered this distribution: “Why?” Indeed, why do we need Arch Linux when there are plenty of other user-friendly distributions, such as God forbid Ubuntu, Debian, Linux Mate, etc. And the answer is very simple: Arch is one of the lightest and most compact distributions that does not carry even desktop environment, out of the box we are given only a console and a few stock utilities (for example fdisk). If you've ever wanted to play a build-it-yourself game, this is the distro for you.

So, let's prepare our “test bench”. In my case, I use Parallels Desktop 12, but exactly a week ago I installed Arch on a Sony Vaio laptop, so the installation process will not be much different.

If you have Wi-Fi

As I already said, the Arch comes bare, but the installer is equipped with a Wifi-Menu utility that allows you to connect to WiFi networks.

1. Beginning

First, let's download the distribution. Release at the time of writing: 2017.05.01. The image weighs 400 megabytes. Kernel 4.10.13. If you are installing the distribution on a virtual machine, you can skip the first step.

1.1 Creating a bootable USB flash drive

There are several ways to create a bootable USB flash drive. Let's look at two of them:

Windows:

UNetBootIN is a free, intuitive utility. Select the flash drive and distribution and click “Continue”, it will do everything itself (it also works on Mac and Linux). Link .

Win32 Disk Imager is a free utility for Windows. Everything is the same: select the flash drive, distribution and click Write. .

Linux/Mac:

For *nix-like systems there is no need to download additional utilities. All you need is to have a terminal at hand. First, let's find a flash drive:

Mac OS: write diskutil list, get a list of all mounted devices.

Linux: write lsblk, get a list of devices. Essentially we get the same thing, only the answer will be like /dev/sdX (X is a letter, for example /dev/sdb1)

Now that we have decided on the flash drive, let's write the image onto it. We will do this using the dd utility. Open the terminal (if you closed it) and enter the following there
dd if=path/to/archiso.iso of=path/to/flash status=progress
Ready. Let's move on to the next step.

2. Installation of the basic system

So, reboot the computer and boot from the flash drive. First we get to the SysLinux menu, where we select “Boot Arch Linux x86_64”. So, we are surrounded by zSH (bash replacement).

First, let's check our Internet connection. If you use ethernet, then you don’t need to do any additional manipulations; Arch will pick up everything on its own. If you are using wifi then enter wifi-menu and you will see a list of wifi networks available for connection. By the way, if you have several adapters, then enter iw dev to see all available adapters (usually the name begins with the letter w), then enter wifi-menu(instead - your adapter). Now let's check the connection by pinging, for example, Yandex.

# ping -c 3 ya.ru PING ya.ru (93.158.134.203) 56(84) bytes of data. 64 bytes from www.yandex.ru (93.158.134.203): icmp_req=1 ttl=54 time=62.4 ms 64 bytes from www.yandex.ru (93.158.134.203): icmp_req=2 ttl=54 time=63.0 ms 64 bytes from www.yandex.ru (93.158.134.203): icmp_req=3 ttl=54 time=62.4 ms --- ya.ru ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2002ms rtt min/ avg/max/mdev = 62.423/62.623/63.009/0.273 ms
The Internet is ready. Now let's check our disks. We drive in lsblk to see where we have what. So, my main disk on which the system will be located is located on /dev/sda, the flash drive is on /dev/sdb (sdb1).

As you can see, the disk is not partitioned. Now we will make two partitions for the /system and /home directory (where the entire user-accessible environment will be located).

We will use the fdisk utility, since it has a graphical interface and is more convenient (for me) to work with.

Enter fdisk into the console. He may ask us whether we need gpt or dos(MBR). For systems with UEFI/GPT, select gpt, for LegacyBIOS/MBR systems - dos. In my case, we will create GPT markup. A more or less familiar gui will appear.

Click “New”, enter the desired value of the SIZE type , where G are gigabytes, MB are megabytes, KB are kilobytes, B are bytes. In my case, I will create a partition /dev/sda1, which will eat up 20 gigabytes for the system, dev/sda2, which will eat up 44 gigabytes for /home, and a partition of 1023 megabytes for swap.

Click the Write button to write the table as a partition to disk and Quit to exit the utility.
Let's check the partitions by entering lsblk again:

Now let's create a file system for each partition. We will use ext4 for the system and /home directory, and swap for swap.

Enter the following commands into the terminal:

# mkfs.ext4 /dev/sda1 # mkfs.ext4 /dev/sda2 # mkswap /dev/sda3 # swapon /dev/sda3
Let's check the partition configuration again. As you can see, the mountpoint of /dev/sda3 has changed to , which means that we did everything correctly.

Now let's mount the disks.

# mount /dev/sda1 /mnt # mkdir -p /mnt/home # mount /dev/sda2 /mnt/home
You can type lsblk to check the mount points. I did it, I had no errors. Let's move on to installing the basic system. To do this, enter the following into the terminal:

# pacstrap /mnt base base-devel

Important

Edit the /etc/pacman.d/mirrorlist file using nano. Before all the contents of the file, add the line:

Server = http://mirror.yandex.ru/archlinux/$repo/os/$arch
Thus, we will add a Yandex mirror and further downloads will come from it. This is very important, since by default some distant download server is installed there. For example, at the time of writing this article, downloads from there were not happening at all.


The downloading and installation process will take some time, so feel free to go drink beer/tea/etc.

For those with Wi-Fi

In the base system ABSENT the ability to work with wi-fi, so install dialog and wpa_supplicant there to work with wireless networks using packstrap:

# pacstrap /mnt wpa_supplicant dialog

3. Setting up the basic system

So we installed the system. Now let’s go into it and configure it from the inside by entering the command:

# arch-chroot /mnt
Now we have left the live environment and are already working directly with the system. The dhcpcd daemon will automatically pick up the ethernet connection; for wifi, use the wifi-menu.

Let's set the locale (language) for our system. Let's open the /etc/locale.gen file using nano, find and uncomment the following lines:

en_US.UTF-8 UTF-8
ru_RU.UTF-8 UTF-8

Then we enter:

# locale-gen
to generate locales.

Let's create a file locale.conf, which will contain a variable for the current locale and write into it the variable LANG=ru_RU.UTF-8 or LANG=ru_RU to set the Russian language:

# export LANG=ru_RU.UTF // set the language for the current session # echo LANG=ru_RU.UTF-8 > /etc/locale.conf # loadkeys ru // load the Russian layout
We can also write locale > /etc/locale.conf instead of echo LANG..., provided that we are satisfied with the locale output:

Now let's install the console font for work. Let's run the following commands:

# setfont cyr-sun16 # nano /etc/vconsole.conf
Add the following lines to the vconsole.conf file

KEYMAP=en
FONT=cyr-sun16

Let's set the clock. Let's enter:

Ln -s /usr/share/zoneinfo/Zone/Subzone /etc/localtime
For example, for Novosibirsk I will enter the following:

Ln -s /usr/share/zoneinfo/Asia/Novosibirsk /etc/localtime

If the error

You may encounter a “file already exists” error. Don't worry, just add the -f switch after the -s, which will overwrite the file.


Let's ensure the hardware clock is accurate with timedatectl set-ntp true , and then enter hwclock --systohc --utc to set the clock.

Let's set the name of our host/domain with the command echo localdomain > /etc/hostname, where localdomain is your name (can be anything, in my case it will be furrypaws).

Now let's set a password for the superuser using the passwd command.
And we generate the kernel with the command:

Mkinitcpio -p linux
Let's generate a partition table. To do this, return to the live environment with the exit command and execute

# genfstab -U /mnt >> /mnt/etc/fstab
Don't forget to check the /mnt/etc/fstab file via nano. Let's go back to chroot to complete the setup via arch-chroot /mnt.

Let's install the bootloader (i.e. GRUB). Enter the following:

# pacman -S grub // pacman -S os-prober, add this additionally if you have other systems besides Arch. # grub-install --recheck /dev/sda # grub-mkconfig -o /boot/grub/grub.cfg
We exit the environment with the exit command and reboot with the reboot command. After the reboot, if we did everything correctly, we will be taken to the Grub menu, and from there to Arch. Login login is root, the password is the one we specified. Establish an Internet connection via wire:

Enter

# ip link
We find our interface there. Then we type in:

# systemctl enable [email protected]


WiFi
We drive in:

#wifi-menu
We establish a connection, then enter:

# cd /etc/netctl # ls
The profile name will start with wlp.

Now we enter:

# netctl enable profile_name
and enjoy the automatic connection.


For reference: our system currently occupies only 1.5 gigabytes. Not bad, right?

4. Installation of the graphical environment

At this point, Parallels crashed and subsequently refused to start the virtual machine, so I was forced to migrate to VirtualBox. Nothing has changed except the partition table on the disk has become DOS.

Install xorg (X Window Manager).

# pacman -S xorg xorg-xinit xorg-twm xterm
If you're interested, we can start the environment with the startx or xinit command and see what happens:

It is only the “foundation” that has been found for the future of everything.

By the way, let's make a user for ourselves with the following command and continue to work through it using sudo.

# useradd -m -g users -G wheel,games my_user
Let's configure sudo access for users. Enter the command visudo, find the commented line


Uncomment it, press esc, then “:wq” and press Enter. Now let's go to our user environment with the su command my_user and we will continue to work from under it.

I will use Plasma for work, you can choose any DE you like.
I will install it with the command:

# sudo pacman -S plasma-desktop plasma-meta sddm # sudo pacman -S breeze-gtk breeze-kde4 kde-gtk-config # sudo pacman -S kde-applications networkmanager plasma-nm powerdevil
The latter will take a very long time to install (it will download 700 megabytes of packages and install about 2 gigabytes), so you can go have some tea.

Important

If you need a lightweight desktop environment, install lxde and lxdm.


After installation, write the following:

# echo "exec startkde" > ~/.xinitrc # systemctl enable sddm # systemct disable dhcpcd # sudo reboot
After the reboot, the SDDM login window will open; by entering the password, we will be taken to our working environment.

# systemctl enable NetworkManager # systemctl start NetworkManager
That's all. The end.

Operating systems of the Winows family are leading in the computer market. But sometimes there is a need to use third-party and free software due to personal preference or the inability to purchase a license for Windows. In this case, Linux OS comes to the rescue. But not all of them have friendly interfaces and extensive documentation. And if the latter is present, it is often only in English, the knowledge of which not everyone can boast of. But, unlike closed source software, Linux systems have the ability to be much more widely customized for a specific user. The article describes in detail the features of installing ArchLinux and this system as a whole.

ArchLinux. Installation and configuration

There is a very interesting operating system from the Linux family. It's called ArchLinux. Its unusualness lies in the fact that, unlike packaged “ubuntu-like” systems, ArchLinux can be customized down to the last “screw”. True, this requires considerable knowledge in this area, which often scares away beginners. And in general, the entire system, unlike packaged distributions, is designed for a very experienced user of “Linux-like” systems who can work with the command line and terminal. Installing and configuring ArchLinux differs in many ways from the installation process of other operating systems. And in this article we will analyze all the stages of installing the ArchLinux OS.

General information about ArchLinux

ArchLinux is a fork of the very minimalistic CRUX OS. This OS was popular among those who liked to build a system from source code and customize it as much as possible. Unlike the “parent” OS, ArchLinux does not require the user to be able to compile kernels and build dependencies. It can be installed using a regular graphical manager. Although the installation of ArchLinux begins with But more on that below.

At the moment, there are two development branches of the ArchLinux OS: stable and current. Stable uses a stable version of the operating system with proven programs. However, you have to wait a very long time for updates. For lovers of everything “fresh”, there is a current branch. Here updates are not late, but system stability is somewhat lacking. ArchLinux also causes some difficulties and errors in it. Experienced “archers” (as ArchLinux users are called in slang) advise using the stable version of the OS. It may not be entirely relevant, but stability is above all.

The problem with ArchLinux is the lack of installation documentation in the distribution itself. There are only general recommendations intended for advanced users of the Linux operating system. And they are all in English. True, some of them are translated by enthusiasts. So installing ArchLinux for beginners is a rather difficult task, let’s look at it in a little more detail.

Preparation for the procedure

The first step is to create a bootable USB flash drive with the ArchLinux distribution. To do this, we need to download the ISO image of the OS from the official website of the project. There are two types of ArchLinux images: full and basic. The difference is the size of the image and the number of programs available out of the box. The full image weighs about 600 MB, and the basic one is only 200 MB. It is better to use the full version of the installation disk.

After downloading, you need to select a program to burn the distribution onto a USB drive. If you are using Windows, then the best option for this purpose would be to use the Rufus program. It can be downloaded completely free of charge and does not require installation. Launch Rufus and select the downloaded disk image with the OS. Click the “Start” button. During the recording process, the USB storage device will be formatted and renamed to ArchLinux. The installation on the flash drive is basically complete. Now you can reboot and try to install the OS on your computer.

Running the installer

After all the manipulations with the boot order in the BIOS, we start loading ArchLinux from the flash drive. As mentioned above, the step-by-step installation of ArchLinux differs in many ways from the same process of packaged OSes. Therefore, it is important to consider all the details and features here.

The first thing we will see is the command line. To launch the graphical installer, you need to type the command $/arch/setup. After this, the installer window will appear. There are menu items that reflect all stages of the installation process:

  • disk preparation;
  • selection of packages;
  • installing packages;
  • installing the kernel;
  • system configuration;
  • bootloader installation;
  • exit.

If even a beginner can cope with most sections of the menu, then even advanced users will have to work hard with the “Installing the kernel” item. This is why installing ArchLinux is not an easy task for beginners.

Preparing the Disk

The disk partitioning process for ArchLinux is somewhat different from the requirements for partitions of other packaged operating systems of the Linux family. The easiest way is to let the program itself distribute the disk into partitions. In this case, the automation knows better what exactly is needed for the system. However, if there are the necessary files on the HDD, you will have to do manual partitioning so as not to lose them forever. Installing ArchLinux starts here.

When manually partitioning a disk, you need to create the following partitions:

  • root partition labeled /;
  • partition /usr;
  • section /opt;
  • section /var;
  • section /var/abs;
  • section /var/cache/pkg;
  • section /var/cache/src;
  • "/home" section.

Now let's look at what they are all needed for.

The root partition must be at least one gigabyte. This is where ArchLinux is installed. The /usr partition is a “swap” - to improve system performance. Therefore, it should be equal to the amount of installed RAM multiplied by two.

The /opt section is used to place large files such as QT libraries, “X” and other files of the OS working shell. Its size should be approximately 4 GB.

Partitions marked /var are used to store various system information in order to prevent cluttering the root.

Well, the /home partition is used to store the user’s personal data. The preferred file system for all partitions is ext3.

System installation

Installing ArchLinux is divided into several stages. The first is the selection and configuration of packages. If you have no idea which ones you need to check for your computer, then just leave all the default values. After analyzing the hardware, the program itself will decide what is needed and what is not. During the installation of packages, a bootloader will also be installed. On ArchLinux, the default is GRUB.

The next step is to install the system kernel. Here, too, it is better to rely on automatic selection and configuration. The only thing you will need to note yourself is the type of kernel for your hardware. If you have a PC that supports SCSI technology, then you need to choose this type.

After successful installation of the kernel, it will be time to configure the OS. Here you are asked to configure the system by editing text configuration files. It is better not to do this, since you can easily “hang” the system during installation. Setting up ArchLinux after installation is the most acceptable option, since it is much easier to do everything using a graphical environment.

Setting up ArchLinux

After rebooting the system, you need to determine its basic parameters. The preferred desktop environment for ArchLinux is KDE. This is exactly what we will install. To do this, type pacman -S kde on the command line. After loading the graphical shell, system setup will go faster. Now we need to install at least the Mozilla Firefox browser to gain knowledge about ArchLinux fine-tuning after installation. To do this, run the following command: pacman -S firefox. Now you can easily learn about the secrets of OS parameters from the “great and mighty” Google.

Installing programs

It's not that simple here. Since ArchLinux does not support a graphical installer for software packages, you will have to install them manually via the command line using the pacman tool. Thanks to some commands you will be able to get all the necessary software. So, the main command for installing programs is pacman -S package_name. To update already installed ones, you need to enter the command pacman -Syi. This is how programs are installed. ArchLinux in this regard is much more complex than “ubuntu-like” systems.

ArchLinux and Steam

Steam is a working environment for purchasing and installing games for Linux. It is also available for Windows OS. The Steam program allows you to purchase and install various games. Moreover, there are also “native” versions for Linux. Installing Steam on ArchLinux requires some additional manipulations, which we will now discuss.

The problem is that there is no official support for ArchLinux on Steam. Therefore, before running the install command, you need to add some repositories and fonts first. If you have a 64-bit system, then you need to download the multilib repository, and after it the Arial font, since that is what Steam uses. You can get it using the pacman -S ttf-liberation command. After this, you can begin installing Steam itself using the command pacman -S steam.

Conclusion

Now we know how to properly install and configure ArchLinux. Of course, the process is quite complicated and requires a lot of free time. Only you can decide whether such an operating system is really needed. Moreover, we even looked at such a “scary” thing as installing Steam on ArchLinux. Of course, it will not be useful to many. But if you are a gamer, then this information will definitely come in handy. In general, ArchLinux is a good OS for expanding your knowledge base.

If you are not afraid of difficulties in the process of mastering new things, then you will like ArchLinux. And although the brainchild of Microsoft Corporation is still leading the market, open source software is gaining more and more popularity every year.