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.

Share:
20,878

Related videos on Youtube

pandita
Author by

pandita

Updated on September 18, 2022

Comments

  • pandita
    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
    pandita almost 5 years
    This worked well! So just to clarify, pacman also doesn't keep track of who installs something?
  • Fox
    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 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
  • Ryan Ward
    Ryan Ward over 4 years
    Try comm -23 <(pacman -Qqett | sort | uniq) <(pacman -Qqg base -g base-devel | sort | uniq) So they are both in the same sorted order
  • memeplex
    memeplex almost 4 years
    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.
  • Rahat Zaman
    Rahat Zaman almost 2 years
    This answer is no longer working as now base is not a group, but a meta-package.