The Ultimate Guide to Pacman Commands on Arch Linux
If you’re a fan of classic video games, you’ve likely played or at least heard of Pacman. On Arch Linux, Pacman is the default package manager for installing, removing, and updating software packages. Here is the ultimate guide to Pacman commands on Arch Linux.
Installation
To install a package, use the following command:
“`
sudo pacman -S package-name
“`
For example, to install the web browser Firefox, use:
“`
sudo pacman -S firefox
“`
Updating
To update all installed packages, use the following command:
“`
sudo pacman -Syu
“`
This command updates the package database and upgrades all packages to their latest versions.
Removal
To remove a package, use the following command:
“`
sudo pacman -R package-name
“`
This will remove the package and any dependencies that are no longer needed.
Search
To search for a package, use the following command:
“`
pacman -Ss search-term
“`
For example, to search for text editors, use:
“`
pacman -Ss text editor
“`
This will output a list of packages that match the search term.
List
To list all installed packages, use the following command:
“`
pacman -Q
“`
Or to list only the installed packages that were explicitly installed by the user (as opposed to being pulled in as dependencies), use:
“`
pacman -Qe
“`
Dependency Information
To see a package’s dependencies (i.e. other packages that need to be installed for it to work), use the following command:
“`
pacman -Si package-name
“`
This will output information about the package, including its dependencies.
File Information
To see which package a file belongs to, use the following command:
“`
pacman -Qo /path/to/file
“`
This will output the package name that provides the file.