Sagar.BlogArticle
All posts
All posts
Linux

pacman — Package Management on Arch Linux

Use pacman to install, update, and manage packages on Arch Linux, Manjaro, and other Arch-based distributions.

March 19, 20255 min read
linuxpacmanarchmanjaropackages

Essential pacman Commands

sudo pacman -S nginx             # Install (Sync)
sudo pacman -R nginx             # Remove
sudo pacman -Rs nginx            # Remove with unneeded dependencies
sudo pacman -Syu                 # Full system upgrade (sync + update)
pacman -Ss "web server"          # Search repos
pacman -Qi nginx                 # Package info (installed)
pacman -Ql nginx                 # Files installed by package
pacman -Q                        # List all installed packages
sudo pacman -Sc                  # Clean old package cache

Flag Quick Reference

FlagAction
-SSync (install from repos)
-RRemove
-QQuery installed packages
-SyuFull system upgrade
-SsSearch repos
-QsSearch installed packages

AUR — Arch User Repository

The AUR is a community repository with thousands of extra packages not in the official repos. Use an AUR helper like yay to install them.

# Install yay AUR helper (first time)
git clone https://aur.archlinux.org/yay.git
cd yay && makepkg -si

# Use yay just like pacman
yay -S package-name              # Install from AUR
yay -Syu                         # Update everything (official + AUR)
yay -Ss package-name             # Search AUR

Always run sudo pacman -Syu before installing packages on Arch. Arch is a rolling release — partial upgrades can break things.

Quick Check

What does `pacman -Syu` do?

Exercise

On an Arch system, sync the package database and install neofetch.