Arch Linux is a Linux distribution composed predominantly of free and open-source software that expects a little more from its user. You must be willing to make some effort to understand the system’s operation. But, if you want more control over what gets installed on that system and how it runs, then this distribution might be for you. (This distribution is not ideal for Linux beginners, unless you enjoy doing things the hard way!) Arch Linux uses a rolling release model, such that a regular system update is all that is needed to obtain the latest Arch software. For people that have run other versions of Linux, some of the first differences users will notice are the setup/management of networking and package management.
A server with Arch Linux installed. If you do not have a server already, you can spin up a Linux Server in under 30 seconds.
Basic Arch Linux Commands
This article will cover some basics to give you start with Arch Linux, including setting the hostname, using basic network adapter functions, and using the Arch Linux package manager, called, simply enough, “pacman”.
Setting the Arch Linux hostname:
To change your server’s hostname, use the hostnamectl command (with most of these commands, you will likely need to either prepend sudo, or already be logged in as root).
hostnamectl set-hostname "your hostname"
Using the Arch Linux network adapters
Enabling and disabling interfaces:
To verify which interfaces are on your server and what state they are in, you can use the ip link command:
To see the IP addresses configured on these interfaces, use ip addr instead.
To enable or disable a particular interface, use the appropriate ip link command, substituting your interface name for the interface you want to affect.
ip link set eth0 up
ip link set eth0 down
(Pro-Tip: Remember which interface you are using to access this server, if you are accessing this server remotely via ssh, for example. If you disable the wrong interface, you could knock your session offline!)
Network interface file location:
If you’d like to make any changes to the interface file, open up the following file using your text editor of choice:
If you’ve made changes to your /etc/netctl/eth0 file, for example, you can get those changes to take effect by restarting networking on that interface:
netctl restart eth0
Using the Arch Linux package manager (pacman)
Refreshing the package list
This command is similar to apt-get update in Debian/Ubuntu-based systems and should be run in a similar fashion, before installing any new packages.
Installing a package
If you know the name of a package, you can install with just the -S option (think “synchronize”).
pacman -S <package-name>
* The ‘sl’ package is a fun little addition that, when installed and invoked, gives you an animated ASCII steam locomotive. It’s best utilized if you’re prone to mistyping ‘ls’ as ‘sl’.
Searching for available packages
If you’re not sure of the package name, you can search with the -Ss options.
pacman -Ss <search term>
Removing a package
Removing a package requires the use of the -R option:
pacman -R <package-name>
Upgrading all packages
To update all packages installed on your system, the command takes the additional -u option. If, as above, you are familiar with Debian/Ubuntu, this command is the equivalent of apt-get upgrade.