Mon 24th August 2020 By David T. Sadler.
As a regular Ubuntu user I am used to using apt for system maintenance. But now that I've installed Arch Linux I will be using pacman and so below is a cheat sheet for myself that shows the pacman equivalent of some common apt actions.
Action | Apt | Pacman | ---------------------------|--------------------------------|----------------------------| Install a package | apt install <package name> | pacman -S <package name> | Remove a package | apt remove <package name> | pacman -Rs <package name> | Search for a package | apt serch <search term> | pacman -Ss <regexp> | Upgrade packages | apt update && apt upgrade | pacman -Syu | Upgrade distribution | apt update && apt dist-upgrade | pacman -Syu | Clean up local caches | apt autoclean | pacman -Scc | Remove unused dependencies | apt autoremove | pacman -Qmq | pacman -Rs - |
$ pacman --sync <package name>
$ pacman -S <package name>
Installs a package and its dependencies.
$ pacman --remove --recursive <package name>
$ pacman -Rs <package name>
Removes a package and all its dependencies, provided that (A) they are not required by other packages; and (B) they were not explicitly installed by the user.
$ pacman --sync --search <regexp>
$ pacman -Ss <regexp>
Searches in the sync database for packages with a name or description that match the regexp.
$ pacman --sync --refresh --sysupgrade
$ pacman -Syu
Downloads a fresh copy of the master package database and then upgrades all out-of-date packages.
$ pacman --sync --refresh --sysupgrade
$ pacman -Syu
Since Arch uses a rolling release system there is no distribution version as you just upgrade your packages to their latest versions.
$ pacman --sync --clean --clean
$ pacman -Scc
Free up disk space by removing from the cache any packages that are no longer installed. Also removes any cached sync databases.
$ pacman --query --deps --unrequired --quiet | pacman --remove --recursive -
$ pacman -Qdtq | pacman -Rs -
Remove dependencies that are no longer needed, because e.g. the package which needed the dependencies was removed.
I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.
Email david@davidtsadler.comCopyright © 2021 David T. Sadler.
Return to Homepage.