Managing packages on Arch Linux is honestly a joy to behold once it is fully understood. This is a collection of useful tips and tricks that I have picked up over the years using Arch.
The Arch official repositories according to the ArchWiki contain "essential and popular software" and are maintained by the package maintainers that are part of the core Arch team. The official repositories are made up of core, extra, multilib and testing. Typically a user is already familiar with the first two, the third if you are a gamer (it is used to install 32-bit versions of libraries); but testing is usually new to a lot of users. The testing repository is used for testing packages that are soon to be migrated into one of the other repositories (ie. currently in testing).
Arch User Repositories (AUR)
The AUR (or Arch User Repositories) simply put, contain everything else. The AUR is a community-driven repository where users can contribute packages and/or vote on package submissions to be moved into the community repository. Normally access to packages in the AUR require the use of a 3rd party package utility or by building them manually, once moved into community they can be directly accessed over pacman.
|WARNING: Due to a security issue where files are sourced before giving the user a chance to interact, it is not recommeneded to use packer or yaourt.|
I personally use pacaur and would also recommend the same to anyone.
AUR Helper Installation
To install aur:pacaur first manually install cower.
|# git clone https://aur.archlinux.org/cower.git|
# cd cower && makepkg -si && cd .. && rm -rf cower
|If makepkg complains about GPG keys see this pinned comment or use gpg --recv-keys --keyserver hkp://pgp.mit.edu 1EB2638FF56C0C53|
Then proceed to install pacaur manually.
|# git clone https://aur.archlinux.org/pacaur.git|
# cd pacaur && makepkg -si && cd .. && rm -rf pacaur
Given that pacaur is a pacman wrapper in addition to being an AUR helper, all syntax that is valid for pacman is also valid for pacaur.
|pacaur -Qdt # list all packages which are orphaned|
pacaur -Qo # determine which package owns a given file
pacaur -Ql # list all files installed by a given package
pacaur -R # delete a single pacakage
pacaur -Rs # delete a single package and all unused dependencies
pacaur -Sc # delete all not currently installed package files (not recommended)
pacaur -Scc # delete all installed package files (not recommended)
paccache -dv # keep last 3 of each package in cache, delete the rest (dry run)
paccache -rv # keep last 3 of each package in cache, delete the rest
paccache -ruk0 # delete all packages in cache that aren't installed
pacaur -Syu # upgrade packages (synchronise before)
pacaur -Syu --devel # upgrade packages including development ones.
pacaur -Syyu # force refresh and upgrade packages
pacaur -S # install package(s)
pacaur -Sw # downloads package(s) but does not install them
pacaur -U # install package from a file
pacaur -Si # show information about a package
pacaur -Ss # search for package(s)
pacaur -Qs # search for package(s) in the local database
pacaur -Qi # show information about a package in the local database
pacaur -Fy # sync the file database
pacaur -Fs # show which package installed a certain file (requires: file database)