created: 06.11.2018 18:22

edited: 09.01.2019 11:43


That will show you every package you've explicitly installed. Except for packages belonging in the "base" and "base-devel" groups, the packages that were initially installed when you installed Arch.

pacman -Qei | awk '/^Name/ { name=$3 } /^Groups/ { if ( $3 != "base" && $3 != "base-devel" ) { print name } }'

Deinstall all unneeded packages or unneeded depandancies.

sudo pacman -Rsn $(pacman -Qdtq)

List all packages installed from the AUR.

pacman -Qm

Cleaning the package cache
Pacman stores its downloaded packages in /var/cache/pacman/pkg/ and does not remove the old or uninstalled versions automatically. This has some advantages:

It allows to downgrade a package without the need to retrieve the previous version through other means, such as the Arch Linux Archive.
A package that has been uninstalled can easily be reinstalled directly from the cache folder, not requiring a new download from the repository.
However, it is necessary to deliberately clean up the cache periodically to prevent the folder to grow indefinitely in size.

The paccache script, provided within the pacman-contrib package, deletes all cached versions of installed and uninstalled packages, except for the most recent 3, by default:

sudo paccache -r

Enable and start paccache.timer to discard unused packages weekly.

sudo systemctl enable paccache.timer --now