pacman - get list of packages installed by user
20,878
Arch Linux doesn't really have a set of default packages, though if you install from the guide you likely installed the base
package group, and possibly base-devel
. You can use comm
to filter these (I'm assuming bash
here):
comm -23 <(pacman -Qqett | sort) <(pacman -Qqg base -g base-devel | sort | uniq)
You can use Qqe
instead of Qqett
if you want to include explicitly-installed packages that are also dependencies of some other package.
Related videos on Youtube

Author by
pandita
Updated on September 18, 2022Comments
-
pandita 3 months
How can I get a list of packages that were explicitly installed by a user?
I'm aware of:
pacman -Qe pacman -Qi
But those seem to include the default packages for my distribution (e.g. sudo). I want to list only the packages that were installed by a user using e.g. "pacman -Syu newpackage"
-
pandita almost 5 yearsThis worked well! So just to clarify, pacman also doesn't keep track of who installs something?
-
Fox almost 5 years@pandita On my system, attempts to install software as non-root yields
error: you cannot perform this operation unless you are root.
If you usesudo
, you become root. So as far aspacman
can tell, the only user who can install a package is root and there's no need to track that -
Ryan Ward over 4 yearsTry
comm -23 <(pacman -Qqett | sort | uniq) <(pacman -Qqg base -g base-devel | sort | uniq)
So they are both in the same sorted order -
memeplex almost 4 yearsThis has a problem with circular dependencies. For example, jupyter is required by X which is required by Y .... which is required by jupyter. So although I explicitly installed it and it won't be installed as a dependency of any listed package, jupyter itself is not listed, which makes the output of this command unable to ensure reproducibility.
-
Rahat Zaman almost 2 yearsThis answer is no longer working as now base is not a group, but a meta-package.