Pacman Tips

Table of Contents


Taken from pacman and pacman/Tips and tricks, commands I use, but sometimes forget about invocation syntax.

First thing first:

List of packages explicitly installed

Packages explicitly installed:

pacman -Qe

Installed in the last 20 days:

expac --timefmt='%Y-%m-%d %T' '%l\t%n' | sort | tail -n 20

Information about packages

Use Q for local and S for remote

pacman -Ss search-string
pacman -Si package-name
pacman -Sii
pacman -Sl

Browsing packages

pacman -Qq | \
fzf --preview 'pacman -Qil {}' --layout=reverse \
--bind 'enter:execute(pacman -Qil {} | less)'

Remove a package and its dependencies

pacman -Rsn

List which package owns a file

To query the database to know which package a file in the file system belongs to:

pacman -Qo /path/to/file_name

To query the database to know which remote package a file belongs to:

pacman -F /path/to/file_name

Listing Packages not required as dependencies

Explicitly installed:

pacman -Qet

Not required as dependencies any longer (orphans):

pacman -Qtdq

Identifying files not owned by any package

sudo lostfiles