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"

3 Answers 3


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-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.

  • 1
    @pandita On my system, attempts to install software as non-root yields error: you cannot perform this operation unless you are root. If you use sudo, you become root. So as far as pacman can tell, the only user who can install a package is root and there's no need to track that
    – Fox
    Dec 10, 2017 at 10:03
  • 1
    Try comm -23 <(pacman -Qqett | sort | uniq) <(pacman -Qqg base -g base-devel | sort | uniq) So they are both in the same sorted order Jun 4, 2018 at 13:27
  • 1
    This 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.
    – memeplex
    Feb 21, 2019 at 9:06
  • 4
    This answer is no longer working as now base is not a group, but a meta-package. Feb 12, 2021 at 7:11
  • 1
    @RahatZaman I believe you just have to remove the base package from the query: comm -23 <(pacman -Qqett | sort | uniq) <(pacman -Qqg base-devel | sort | uniq) its now working for me and the output appears to make more sense. Mar 19, 2023 at 17:17

simpler solution, that keeps historical order:

grep -i installed /var/log/pacman.log

however you will have upgrades in this list, and it will not contain explicitly installed only


alternate option that will include AUR

# packages installés explicitements - la base - les foreign
pacman -Qqe | grep -vx "$(pacman -Qqg base-devel)" | grep -vx "$(pacman -Qqm)" > main.lst

## Create local.lst of local (includes AUR) packages installed
# que les foreign
pacman -Qqm > aurandlocal.lst

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .