Selected topic

Pacman

Package Management

Prefer practical output? Use related tools below while reading.

What is Pacman?

Pacman (short for package manager) is the default package management tool for Arch Linux and other derivatives. It allows you to easily install, update, and remove packages on your system.

Basic Commands:

  1. Install a package: sudo pacman -S <package_name>
Example:
bash
sudo pacman -S firefox
This will download and install the Firefox browser.
  1. Update all packages: sudo pacman -Syu
Example:
bash
sudo pacman -Syu
This will update your system to the latest version of all installed packages.
  1. Remove a package: sudo pacman -R <package_name>
Example:
bash
sudo pacman -R firefox
This will remove the Firefox browser from your system (along with any dependencies).

Advanced Commands:

  1. Search for a package: sudo pacman -Ss <search_term>
Example:
bash
sudo pacman -Ss &quot;browser&quot;
This will search for packages containing the term "browser".
  1. List all installed packages: pacman -Qe
Example:
bash
pacman -Qe
This will list all installed packages, including their versions.
  1. Check for package updates: sudo pacman -Qu
Example:
bash
sudo pacman -Qu
This will check for available updates and display a list of packages that need to be updated.
  1. Clean up package cache: sudo pacman -Scc
Example:
bash
sudo pacman -Scc
This will remove any unnecessary package files from your system's cache.

Troubleshooting:

  1. Check for conflicts: pacman -Qdtq
Example:
bash
pacman -Qdtq
This will list all packages that are no longer required due to dependencies being removed or upgraded.
  1. Check for broken dependencies: sudo pacman -Dkc
Example:
bash
sudo pacman -Dkc
This will remove any packages with broken dependencies from your system's cache.

Remember to always use sudo when running Pacman commands, unless you're comfortable managing package permissions manually!