Package Management In Arch Linux


Using Arch Linux as your operating system has its own advantage. It uses a rolling release model which means there is no major release of a new version instead a regular update is sufficient to obtain the latest Arch software. Officially it is available for systems based on x86-64 architectures. ArchWiki is a comprehensive documentation of Arch Linux, which is useful for other distribution also.

Pacman is a package manager that is developed specifically for Arch Linux and is used for installation, removal, and up-gradation of software in Arch Linux.

In this article, we will learn about some important packman commands and configuration settings of it.


Pacman

As already discussed above Pacman is a tool used by Arch Linux to install, remove, and upgrade the software packages. It uses binary packages in a .tar.xz format with an easy to use build system. Pacman keeps the system up to date by synchronizing the package list with the master server.


Pacman commands

It has three core commands for basic package management-
pacman -Q package_name(s) or pacman --query package_name(s) -Searches the package_name(s) in the package database
pacman -S package_name(s) or pacman --sync package_name(s) -Use to install a single package or list of packages, including dependencies.
pacman -R package_name(s) or pacman --remove package_name(s) -It will remove the given package or packages.

Note that flags used in the above commands are in uppercase, lowercase letters are used with these given flags for additional functionality.

pacman -Qo file_name -Displays the version number and package name which contains the given file
pacman -Qi package_name(s) -Display the details of the package(s) including dependency information, date of the package, and a link to the upstream source, etc.
pacman -Qs package_name(s) -Will search for the given package in the list of installed packages
pacman -Qu -List outdated installed packages that are needed for update
pacman -Syu -Will trigger for the full system update and refresh the database
packman -Sy -Will refresh the database and synchronize the local database with the remote database
pacman -Sc -Remove uninstalled packages from the cache and clean up the old copies of the repository database
pacman -Rs -Remove a package along with its dependencies. The dependency will not get removed if it is used by other packages or explicitly installed by the user.
pacman -Ru -Removes packages that are not used or needed by any other packages
pacman -S --ignore package_name(s) -Ignores upgrades to a given package or packages.
pacman -Sw package_name – Download a package without installing it

Configuration option for Pacman

Pacman’s default settings are defined in /etc/pacman.conf file. It also defines a package repository to be used. A repository can be defined as a logical collection of packages, Which are physically stored on one or more remote servers and each of these servers is called a mirror for the repository. The mirror for official repositories are included from /etc/pacman.d/mirrorlist.


Arch Build System(ABS)

The ABS is a port-like system that allows users to compile, build and package software from source code or in other words ABS is a collection of tools for compiling the source into installable .pkg.tar.xz packages.

You can install it by using given command in Arch Linux

packman -Sy abs base-devel

BSD used a port system to automate the porcess of building software from the source code. Basically a port is a small directory in the user’s system that is named after the corresponding software to be installed. The port may contain some files with the instruction for building and installing the software from the source. ABS is a similar concept it is made up of directory trees that can be checked out using SVN. These directories in the tree contains a PKGBUILD file with some other files.

SVN Tree

The files of the software that is to be built are contained in the directory structure which can be found in SVN and git repositories.

PKGBUILD

It is a bash script that contains the URL of the source code along with the compilation and packaging instructions.

makepkg Command

It is a shell command which reads PKGBUILDs, download and compile the source and creates a .pkg.tar and later this package can be installed into your system by using Pacman. You can read the concept of Arch Build System in detail on Arch wiki.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.