General

System update

It is recommended to just do pamac update, to also update packages from AUR, snap, and the like.

Alternative

Note, pacman only upgrades packages from official repositories.

To update package database and update all packages on system

sudo pacman -Syu

To force a full refresh of package database and update all packages on system

sudo pacman -Syyu

To force a full refresh of package database, update all packages on system and allow packages to be downgraded. NOTE: Downgrading should only be needed when switching to an older branch, e.g.: from Testing to Stable.

Listing packages

Explicitly installed packages can be listed by pacman -Qe. Foreign packages, which are packages typically manually installed or packages that are removed from repositories, can be listed by pacman -Qm

Searching for packages

To search for a package with packagename as name or in description

pacman -Ss packagename

To search among already installed packages

pacman -Qs packagename

More information about packages are achieved by

pacman -Qi packagename
pacman -Si packagename

Removing packages

Basic syntax for removing is

sudo pacman -R packagename

To remove a package and its dependencies that are not required by any other package

sudo pacman -Rs packagename

To remove a package and its unused dependencies

sudo pacman -Rsu packagename

To remove unused packages installed via flatpak

flatpak uninstall --unused

Cache

pacman

Manjaro and Arch comes with paccache by default which deletes all cached versions of installed and uninstalled packages, except for the most recent three, by default:

paccache -r

To remove all the cached packages that are not currently installed, and the unused sync database, execute:

pacman -Sc

To remove all files from the cache, use the clean switch twice, this is the most aggressive approach and will leave nothing in the cache folder:

pacman -Scc

pamac

To clear the cache completely, enter the following command (and use with care):

pamac clean

A safer way to remove old package cache files is to remove all packages except for the latest three package versions using:

pamac clean --keep 3

Last updated