pacman is the package manager for Arch Linux. apt is the package manager for Ubuntu and Debian. They do the same job — install, update, and remove software — but with different syntax.
If you’re coming from Ubuntu to Arch (or vice versa), this post maps the commands side by side.
Install a Package
# pacman
sudo pacman -S firefox
# apt
sudo apt install firefox
-S stands for sync — it syncs the package from the remote repository to your system.
Remove a Package
# pacman
sudo pacman -R firefox
# apt
sudo apt remove firefox
This removes the package but keeps its configuration files. To remove everything including config files:
# pacman
sudo pacman -Rns firefox
# apt
sudo apt purge firefox
On pacman, -R is remove, -n removes config files, and -s removes dependencies that are no longer needed by anything else.
Update Everything
# pacman
sudo pacman -Syu
# apt
sudo apt update && sudo apt upgrade
On pacman, this is a single command. -Sy syncs the package database (fetches the latest package list from repos), and -u upgrades all installed packages. Always use -Syu together — running -Sy without -u can cause partial upgrades which break things on Arch.
On apt, it’s two steps. apt update refreshes the package list, and apt upgrade installs the newer versions.
Search for a Package
# pacman
pacman -Ss chrome
# apt
apt search chrome
-Ss searches the remote repositories. This shows package names, versions, and descriptions that match your query.
Get Info About a Package
# pacman (remote package)
pacman -Si firefox
# pacman (installed package)
pacman -Qi firefox
# apt
apt show firefox
-Si shows info from the remote repo. -Qi shows info about the locally installed version — including its size, dependencies, and what depends on it.
List Installed Packages
# pacman
pacman -Q
# apt
apt list --installed
To count how many packages you have installed:
pacman -Q | wc -l
Check What Depends on a Package
# pacman
pacman -Qi firefox | grep 'Required By'
# apt
apt rdepends firefox
This is useful before removing something — you want to make sure nothing else needs it.
Clean Up
Remove cached packages that are no longer installed:
# pacman
sudo pacman -Sc
# apt
sudo apt autoclean
Remove orphaned dependencies (packages installed as dependencies that nothing needs anymore):
# pacman
sudo pacman -Qdtq | sudo pacman -Rns -
# apt
sudo apt autoremove
On pacman, -Qdt lists orphans and the output is piped to -Rns to remove them.
List Files Installed by a Package
# pacman
pacman -Ql firefox
# apt
dpkg -L firefox
Find Which Package Owns a File
# pacman
pacman -Qo /usr/bin/firefox
# apt
dpkg -S /usr/bin/firefox
Handy when you find a binary on your system and want to know which package put it there.
Quick Reference
| Action | pacman | apt |
|---|---|---|
| Install | sudo pacman -S pkg | sudo apt install pkg |
| Remove | sudo pacman -R pkg | sudo apt remove pkg |
| Remove + config + deps | sudo pacman -Rns pkg | sudo apt purge pkg && sudo apt autoremove |
| Update all | sudo pacman -Syu | sudo apt update && sudo apt upgrade |
| Search | pacman -Ss query | apt search query |
| Package info | pacman -Si pkg / pacman -Qi pkg | apt show pkg |
| List installed | pacman -Q | apt list --installed |
| Clean cache | sudo pacman -Sc | sudo apt autoclean |
| Remove orphans | sudo pacman -Qdtq | sudo pacman -Rns - | sudo apt autoremove |
| List files of pkg | pacman -Ql pkg | dpkg -L pkg |
| Find owner of file | pacman -Qo /path | dpkg -S /path |
AUR — Arch’s Secret Weapon
One big difference: Arch has the AUR (Arch User Repository). The official Arch repos are curated and smaller. The AUR is a community-driven repository where anyone can submit build scripts for packages that aren’t in the official repos.
pacman doesn’t interact with the AUR directly. You need an AUR helper like yay or paru:
# install yay, then use it like pacman
yay -S google-chrome
yay -Syu # updates both official and AUR packages
AUR helpers work just like pacman but also search and build packages from the AUR. On Ubuntu, the closest equivalent would be PPAs (Personal Package Archives), but the AUR is far larger and more active.
This blog post was written with the help of Claude.

