![]() |
VOOZH | about |
Pacman is a package manager for the arch Linux and arch-based Linux distributions. If you have used Debian-based OS like ubuntu, then the Pacman is similar to the apt command of Debian-based operating systems. Pacman contains the compressed files as a package format and maintains a text-based package database. Pacman keeps the system up to date by synchronizing package lists with the master server. Pacman can install the packages from the official repositories or your own build packages.
In this article, we are going to see how to use Pacman to manage the software in arch-based systems. Now let's see how to use Pacman.
When we install any new operating system on our machine, the first task we do is to install the software packages on the system. Now, to install the packages on Arch Linux, use the command Pacman with -S option and mention the package name. The -S option tells the Pacman to synchronize and to continue. Here is one example
sudo pacman -S cmatrix
We can mention the many package names after the -S option, separated by space.
sudo pacman -S package1 package2 package3
Then Pacman will show the download and install size of the package and ask for to proceed, then simply press the Y key. Pacman categorizes the installed packages into two categories.
Now let's see how to remove the installed package.
When we don't need the package anymore, then we should remove the package from the system. To remove the package with all its dependencies which are not required by other packages, use the following command:
sudo pacman -Rs <package_name>
To remove the package without removing its dependency use the following command:
sudo pacman -R <package_name>👁 Image
To remove the dependencies which are not required anymore, use the following command:
pacman -Qdtq | pacman -Rs -👁 Image
In arch Linux, we can upgrade the full system by only one command using the Pacman. Use the following command to update the system:
sudo pacman -Suy
Let's understand the meaning, S tell the pacman to synchronize the local database with the main database. u tells the pacman to upgrade the packages and y update the local catch on the system. Basically, this command synchronizes the local pacman database with the main repository database and then updates the system.
👁 ImageNow let's see how we can search the package into the database of pacman. To search query in the name and description of the package in the database use the following command:
sudo pacman -Ss <query1> <query2>👁 Image
To search into already installed packages on the system, use the following command:
sudo pacman -Qs query1> <query2>👁 Image
To search the query into the local database use the following command:
sudo pacman -F query1> <query2>👁 Image
When pacman downloads the packages it stores the packages into the /var/cache/pacman/pkg/ and while uninstalling the package pacman does not delete these files. Pacman uses these files to downgrade the package or install the package. But it can take a lot of space to store these packages. So to delete the stored packages, use the following command:
sudo pacman -Sc👁 Image
To remove all stored packages and catch, use the following command:
sudp pacman -Scc👁 Image
By using pacman we can install packages other than the main repository of Arch Linux. Use the following command to install the packages
For local:
sudo pacman -U path_to_file.pkg.tar.xz
For remote package:
👁 Imagesudo pacman -U http://www.example.com/repo/example.pkg.tar.xz
Sometimes installing the packages with pacman we face some errors. Following are the mainly occurred errors with pacman:
pacman -S --overwrite glob package
rm /var/lib/pacman/db.lock