Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

Linux & Mac & Bash Command Dictionary

  1. Home
  2. Linux & Mac & Bash Command Dictionary
  3. pacman (Arch Linux Package Manager)

pacman (Arch Linux Package Manager)

pacman is the standard package management tool for Arch Linux and its derivatives (Manjaro, EndeavourOS, etc.). Use pacman -Syu to update the entire system, pacman -S to install packages, pacman -R to remove them, and pacman -Qs to search installed packages. For packages not available in the official repositories, you can obtain them from the AUR (Arch User Repository). AUR helpers such as yay let you manage AUR packages using the same syntax as pacman.

Syntax

# -----------------------------------------------
#  Update the system
# -----------------------------------------------

# pacman -Syu
#   → Syncs the repository database (-y) and then
#     upgrades all installed packages (-u)
#   → The standard way to update the entire system on Arch Linux
#   Example: sudo pacman -Syu

# -----------------------------------------------
#  Install packages
# -----------------------------------------------

# pacman -S {package} [{package} ...]
#   → Installs the specified package(s)
#   → Multiple packages can be specified separated by spaces
#   Example: sudo pacman -S neovim
#   Example: sudo pacman -S neovim git curl

# pacman -S {repository}/{package}
#   → Installs a package from a specific repository
#   Example: sudo pacman -S extra/neovim

# -----------------------------------------------
#  Remove packages
# -----------------------------------------------

# pacman -R {package}
#   → Removes the package (leaves dependencies installed)

# pacman -Rs {package}
#   → Removes the package along with any dependencies
#     that are no longer needed by other packages
#   → Recommended for most removals

# pacman -Rns {package}
#   → Completely removes the package including
#     configuration files (.pacsave)

# -----------------------------------------------
#  Search for packages
# -----------------------------------------------

# pacman -Ss {keyword}
#   → Searches repository package names and descriptions by keyword

# pacman -Qs {keyword}
#   → Searches installed packages by keyword

# pacman -Si {package}
#   → Shows detailed information about a package in the repository

# pacman -Qi {package}
#   → Shows detailed information about an installed package

# -----------------------------------------------
#  List packages
# -----------------------------------------------

# pacman -Q
#   → Lists all installed packages

# pacman -Qe
#   → Lists only explicitly installed packages
#   → Does not include automatically installed dependencies

# pacman -Qdt
#   → Lists orphaned dependencies that are no longer needed

# -----------------------------------------------
#  Manage the cache
# -----------------------------------------------

# pacman -Sc
#   → Removes cached packages that are not currently installed

# pacman -Scc
#   → Clears the entire package cache (frees disk space)

Syntax reference

OperationCommandDescription
Update entire systempacman -SyuSyncs the repository database and upgrades all packages to the latest version. The standard maintenance operation on Arch Linux.
Install a packagepacman -S {package}Installs the specified package. Dependencies are resolved automatically.
Sync database onlypacman -SySyncs the repository database without installing any packages. Using this alone is not recommended.
Remove a packagepacman -R {package}Removes the package. Dependencies remain installed.
Remove with dependenciespacman -Rs {package}Removes the package along with any dependencies that were required only by it. Recommended for most removals.
Remove including config filespacman -Rns {package}Removes the package, its dependencies, and its configuration files. Use when you want a complete reset.
Search repositorypacman -Ss {keyword}Searches repository package names and descriptions by keyword.
Search installed packagespacman -Qs {keyword}Searches installed packages by keyword.
Repository package detailspacman -Si {package}Shows version, dependencies, and description for a package in the repository.
Installed package detailspacman -Qi {package}Shows detailed information about an installed package (install date, size, etc.).
List installed packagespacman -QLists all installed packages.
List explicit installspacman -QeLists only explicitly installed packages, excluding automatically installed dependencies.
List orphaned packagespacman -QdtLists orphaned dependencies that are no longer needed. Use pacman -Rns $(pacman -Qdtq) to remove them all at once.
Partially clear cachepacman -ScRemoves cached packages that are not currently installed.
Fully clear cachepacman -SccClears the entire package cache to free disk space.

Examples

# -----------------------------------------------
#  Update the system to the latest state
# -----------------------------------------------

# Sync the repository database and update all packages
sudo pacman -Syu

Run the following command:

$ sudo pacman -Syu
:: Synchronizing package databases...
 core                     151.1 KiB  1234 KiB/s  00:00 [######################] 100%
 extra                      8.0 MiB  5.12 MiB/s  00:02 [######################] 100%
:: Starting full system upgrade...
 Packages to upgrade (3) neovim-0.10.4-1  git-2.48.1-1  curl-8.12.1-1
 Total download size:  12.34 MiB
 Total installed size:  45.67 MiB
:: Proceed with installation? [Y/n] y
Install neovim and verify the installation
# -----------------------------------------------
#  Install and verify neovim
# -----------------------------------------------

# Install neovim
sudo pacman -S neovim

# Check the installed version
nvim --version

Run the following command:

$ nvim --version
NVIM v0.10.4
Build type: Release
LuaJIT 2.1.1736781742
Search installed packages
# -----------------------------------------------
#  Search among installed packages
# -----------------------------------------------

# Search installed packages for names containing "python"
pacman -Qs python

Run the following command:

$ pacman -Qs python
local/python 3.13.2-1
    Next-generation Python programming language
local/python-pip 24.3.1-1
    Tool for installing Python packages
Remove a package and clean up orphaned dependencies
# -----------------------------------------------
#  Remove a package and clean up orphaned dependencies
# -----------------------------------------------

# Remove neovim along with its dependencies and config files
sudo pacman -Rns neovim

# List orphaned dependencies that are no longer needed
pacman -Qdt

Running these commands produces the following output:

$ pacman -Qdt
lua53 0.5.3-1
unibilium 2.1.1-2

The following example demonstrates this:

# Remove all orphaned packages at once
# pacman -Qdtq outputs only package names, which are passed to -Rns
sudo pacman -Rns $(pacman -Qdtq)

Run the following command:

$ sudo pacman -Rns $(pacman -Qdtq)
checking dependencies...
Packages to remove (2): lua53-0.5.3-1  unibilium-2.1.1-2
:: Do you want to remove these packages? [Y/n] y
Install an AUR package using yay
# -----------------------------------------------
#  Install and use yay (AUR helper)
# -----------------------------------------------

# yay itself is an AUR package, so you build it from source with git first
# base-devel (build tools) is required
sudo pacman -S --needed git base-devel

# Clone the yay source from the AUR and build and install it
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

# Verify the yay version
yay --version

Run the following command:

$ yay --version
yay v12.4.2 - libalpm v14.0.0

The following example demonstrates this:

# -----------------------------------------------
#  Package management with yay (same syntax as pacman)
# -----------------------------------------------

# Update the entire system (official repos + AUR)
yay -Syu

# Install google-chrome from the AUR
yay -S google-chrome

# Search including AUR packages
yay -Ss evangelion-font

Run the following command:

$ yay -Ss evangelion-font
aur/evangelion-font-ikari 1.0.0-1 (+12 0.45)
    Evangelion-style font (created by Ikari Shinji)
aur/evangelion-font-nerv 2.1.0-1 (+8 0.32)
    Official NERV logo font

Overview

pacman is the package manager native to Arch Linux, known for its simple and fast design. Options are expressed as combinations of letters, and learning just three — -S (Sync), -R (Remove), and -Q (Query) — covers most everyday operations. Partial upgrades are discouraged on Arch Linux; always use pacman -Syu to update the entire system at once. Software not available in the official repositories (core, extra) can be obtained from the AUR (Arch User Repository), but AUR packages are community-maintained build scripts (PKGBUILD), so it is important to review their contents before use. yay is the most widely used AUR helper and lets you manage both official repositories and the AUR with the same syntax as pacman. For package management on Debian- and Ubuntu-based systems, see the apt page. For RHEL- and AlmaLinux-based systems, see the dnf / yum page.

If you find any errors or copyright issues, please .