Linux Tutorials

Arch Linux Setup Internet, X Installation, System Configuration

arch linux system configuration
In this guide, we boot into our Arch system that we installed in the previous guide. Here, we configure an Internet connection, a couple of troubleshooting tips, and install some software. This software will include a graphical user interface (GUI) provided by the X server. As with everything else, each step will be performed manually, via the terminal.​

Internet

First off, we need to establish that we have an Internet connection. We do this by using ping command.
$ ping archlinux.org
If this returns something like “Network is unreachable”, then we need to connect. First, we need to bring up the network interface. Let’s find out which one we are using to connect.
$ ip address
This will list all of the network interfaces available to you. Here is an example of how to bring the device online.​
$ ip link set up enp0s3
Next, we need to tell systemd to start the DHCP service.
$ systemctl start dhcpcd.service
​Then we need to test the connection using ping.
$ ping archlinux.org

On VirtualBox, I had an issue with ping returning each packet with its own duplicate (DUP!). I fixed this by switching the VM’s network device from using a ‘Bridged Adapter’ through my Wi-Fi to NAT. Restart DHCP to reconnect. We should have DHCP start on boot so we have a connection when the computer loads. To do this we use the ‘enable’ command in systemctl.

$ systemctl enable dhcpcd.service

enabling dhcpcd on startup

The ‘–now’ parameter tells systemctl to start the service as well as enabling it.

Users

We must create at least one other user to use as the main account on this computer. Using the root user as the main account is extremely bad practice. Root has access to the entire system. You can wipe out very important files with one simple command under root. ALWAYS use a user account. The tool we will use for this is called ‘useradd’.On its own, when given the name of the new user, it will create’ the user with the default options specified in the file ‘/etc/useradd/defaults’. When the ‘-D’ option is specified (‘useradd -D’), it will list the defaults that useradd uses when no other parameters are specified. Let’s see a little list of parameters that it accepts:

​The ‘-m’ parameter creates the home directory if it doesn’t already exist. When used on its own, which is what we will do, it will create the user and its home directory in the default base directory (‘/home’). The directory name will be the user’s username, e.g. unix_allsort’. The username must not contain spaces.

$ useradd -m unix_allsort

useradd

We can change which directory the user’s home folder is by either changing the base directory (the ‘-b’ argument), or the home folder name (using ‘-h’) or both. We can also specify the user’s group, its own group ID (GID), and own user ID (UID). Run ‘man useradd’ for more information.​After a user is created, we should assign a password to it. We will begin by using ‘passwd’ to assign one to unix_allsort. You will be asked to provide the password twice to ensure that there was no mistake the first time.

$ passwd unix_allsort

Updates and Software

Now we need to ensure that the latest software packages are installed before we install any other programs. Again ‘pacman’ will be used for this purpose. Ensure that you are the root user, then begin updating your new system. Please look at the Arch Wiki for extra information about things you should be aware of when upgrading your system.
$ pacman -Syu

pacman Syu

The update will also update the initramfs image and its fallback.

pacman Syu after

Once completed, we can then begin to install other software. We will first install a GUI environment consisting of FVWM (window manager), and of course Xorg (X11 server). We shall run these three pacman commands:
$ pacman -S fvwm 
$ pacman -S xorg-server 
$ pacman -S xorg-xinit 
$ pacman -S xterm

We will need xterm if we want to use the terminal during an X session.​In order to launch fvwm when ‘startx’ is run, we must copy the xinitrc template from ‘/etc/X11/xinit’.

$ cp /etc/X11/xinit/xinitrc .xinitrc
Then open up either nano or vim to change what gets launched. Scroll down to the bottom of the file. There you will find the list of things it attempts to run. By default, it will try and run ‘twm’, which is another window manager. Since we don’t have twm installed, it won’t work. As for xclock, we can install that later. Once xclock is installed, it too will run, unless you remove the command of course.

The best thing we can do is simply tell X to only run FVWM when ‘startx’ is run. We do this by either removing the other commands or make them into comments by putting ‘#’ before them. This ensures that X only closes when FVWM does.

xinitrc

Remember to have only ‘fvwm’ there with the ‘&’ at the end removed.​Now save and then run ‘startx’. FVWM should start correctly. With it, you can then invoke ‘xterm’ by clicking on the desktop and pressing ‘XTerm’.

Excellent, we shall now continue installing programs. While we’re in FVWM with an XTerm open, let’s install Firefox. Remember to run ‘pacman’ as root. Switch to root, using the ‘su’ command.​As stated before, the great thing about Arch is that it is completely customizable. I’ve installed Firefox, Thunderbird, and another window manager called ‘IceWM’. Let’s try installing the KDE 5 plasma desktop.

$ pacman -S plasma-desktop
Once completed, you should edit ‘~/.xinitrc’ once more so that ‘startkde’ is the only thing that runs. After saving the changes, then launch X again. You should have a KDE plasma session running.

install kde in arch linux

In the Next Guide

Now that we have a system set up with some software installed, we will look at several different ways to customize the system. Other configurations will be looked at as well.

Our sponsor - Deploy your server within 3 minutes


3 comments

bill November 3, 2020 at 11:05 am

Links to other articles in the series would be helpful.

Reply
Mohd Sohail December 3, 2020 at 3:42 am

Thanks for a friendly reminder. I have linked to other article.

Reply
Martin November 3, 2020 at 2:21 pm

Should mention that those who do not like systemd with it’s security vulnerabilities and it’s growing attack surface, you can use Artix instead https://artixlinux.org

Reply

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More