The pacman package manager is one of the major distinguishing features of Arch Linux. It combines a simple binary package format with an easy-to-use Arch build system. The goal of pacman is to make it possible to easily manage packages, whether they are from the official repositories or the user's own builds.
- Pacman
This details some configuration options for improving the package manager.
The package manager relies on the list of mirrors to download the latest packages.
-
Use
reflector
to update the system's mirror list and sort them by speed:sudo reflector --latest 50 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
[!TIP]
Removesudo
if you are running as the root user.
This details the steps to allow the package manager to download multiple packages in parallel instead of sequentially to speed up the download process.
-
Update the Pacman configuration file:
sudo nano /etc/pacman.conf
-
Make the following changes:
#ParallelDownloads = 5 +ParallelDownloads = <number>
-
Comment the original
ParallelDownloads
line if it is not already commented to override it. -
Add a new
ParallelDownloads
line underneath the original with<number>
being the number of parallel downloads to allow (range of values from1
to5
). -
Example changes:
#ParallelDownloads = 5 ParallelDownloads = 5
-
-
Save the changes to the file.
This details the process of installing software.
-
To install a single package:
sudo pacman -S <package>
As an example, to install the
vim
package:sudo pacman -S vim
-
Optionally, use the
--noconfirm
flag to automatically answer "yes" to all prompts:sudo pacman -S --noconfirm <package>
-
To install multiple packages in a single command, simply separate each package with a space:
sudo pacman -S <package1> <package2> <package3>
This details the process of updating a software or the system.
-
To update a particular package or multiple of them, simply reinstall the package(s).
-
To update the entire system:
sudo pacman -Syu
This details the process of uninstalling software.
-
To uninstall a single package along with its dependencies:
sudo pacman -Rns <package>
As an example, to uninstall the
vim
package:sudo pacman -Rns vim
-
Optionally, use the
--noconfirm
flag to automatically answer "yes" to all prompts:sudo pacman -Rns --noconfirm <package>
-
To uninstall multiple packages in a single command, simply separate each package with a space:
sudo pacman -Rns <package1> <package2> <package3>
This details the process of searching software.
-
To search for a package:
pacman -Ss <package>
As an example, to search for the
vim
package:pacman -Ss vim
This details the process of cleaning up the system.
-
To remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed:
sudo pacman -Rns $(pacman -Qdtq)
-
To delete cached package files of packages that have been installed or removed:
sudo pacman -Scc