How to Use Pacman in Arch Linux – Linux Hint

Arch Linux is a complex Linux distribution, which makes it an annoying Linux operating system. Programmers who do not have a strong Arch-Linux command usually choose other distributions. A remarkable difference between Arch Linux and its other distributions is Pacman. Pacman is a package manager that buffers the use of packages in Arch Linux. It facilitates the use of parcels from the warehouse and self-built parcels. Pacman contains a number of commands that make it easy to manipulate Arch-based packages in the Arch Linux distribution. Pacman also includes binary packages to help you put together a package. For other Linux distributions, obey the apt team; for Arch-Linux, the Pacman team can be useful for more efficient management and creation of the system repository.

This guide offers beginners and professional programmers some basic knowledge about Pacman. It covers all the areas you might need when working with Pacman in Arch Linux. These teams can help you make the management of your Linux-based Arch packages more efficient and convenient.

Pac-Man requesting teams

If you work with Pacman on Arch-Linux, you should be familiar with the following commands to increase the use of this dynamic package manager:

  • Installing a package with Pacman
  • Removing installed packages
  • Updating of the package
  • Package search
  • Cleaning of the packaging lid
  • Installing the local package
  • Troubleshooting

These commands include the use of Pacman and are the basic commands you may need to understand to work with Pacman.

Package installation with Pacman

This is the main domain you select after choosing Arch Linux Package Manager. To obtain software from the system repository or to create a package, the first step is to install it with Pacman. The Pacman command to install one or more packages looks like this:

$ pacman -S _Package name1_ _Package name2_ …

The last set of points stands for continuity in the team. You must replace the name of the package in the above command to install it on your system. Synchronize the installed package before classifying it as a dependent or explicitly installed package using the -S and -U commands.

Removing installed packages

To uninstall a package installed in Arch Linux, you have three main options

  1. Remove only the packaging.
  2. Remove the package and its dependencies.
  3. Remove dependencies only.

To remove only the package, choose the following command:

$ pacman -R packet_name

-R means clear command.
To remove a package with its dependencies, simply execute the following command

$ pacman -Rs _package_name

To remove dependencies from your server, follow the command below :

$ pacman -Qdtq | pacman -Rs –

Package update

In other Linux distributions the package is updated by the apt command. With Arch Linux, a Pacman team not only updates the system packages, but also synchronizes and updates them. The following command updates only the configured packets and not the local packets available on the system:

Here -y for system updates and -you for package updates. The literal value of this command is to synchronize the packet with the database of the main server and then update the packet connected to the database. Finally, this command updates the package when an update is available. Don’t forget to choose a full update, as partially updated packages are not compatible with Arch Linux.

Package search

Pacman is also effective in finding packages in your server’s database by the name and description of the desired package.

$ pacman -Ss _string1_ _string2_

If you are looking for a package that already exists on your system, use the following code. In this code you can add other channels after channel 2 at the same time.

$ pacman -Qs _string1_ _string2_

-Q symbolizes the search for packets in a local database.

$ pacman -F _string1_ _string2_

-F finds deleted packages in the database.

Cleaning of packaging unit

On Arch Linux Pacman does not remove previously installed packages from its repository. You must therefore enter the following command to empty your database cache. This command allows you to delete unsynchronized packets.

To delete all files in the cache, type the following command:

Installation of the local package

If you use Pacman, all you need to do is install local and remote packages that are outside the responsibility of the server repository. The following code installs the local packet after searching for remote storage.

US$ pacman _/path/to/package_name-version.pkg.tar.xz_
US$ pacman

The second code allows you to install remote packages that are not available in the official archive.


When working with Pacman in Arch-Linux, you may encounter one of the following three types of errors:

  • Inconsistent file error
  • Invalid package
  • Locking database

An error in the conflict file is caused by a conflict file in memory. You can rename the file manually or force the overwrite function. The following command is used for the overwrite function:

$ pacman -S -overwrite glob package

Illegal package errors are caused by a partial update of the packages. It is best to look at the package description before installation.
An error in the database lock occurs because the database change process is interrupted.

$ lsof /var/lib/pacman/db.lck

Execute the above command to detect a collision during the lock process. And then you can relock the database.


Pacman is an Arch-Linux package manager that helps with the installation and management of packages and system construction. If you follow this guide, you can manage Pacman easily and with maximum efficiency on your Arch-Linux system. This manual covers most of the commands you need to know when using Pacman.

Related Tags:

install pacman ubuntu,install pacman linux mint,pacman linux game,pacman game install,how to use pacman manjaro,bash: pacman command not found,pacman update mirrors,pacman list installed packages,pacman exists in filesystem,pactree,pacman install specific version,gnu pacman,arch linux commands,sudo pacman -syu,pacman vs pacman (arch),linux how to install pacman,pacman for linux,arch linux distro,pacman aria2c