I want to know which packages were installed by default during installation and which were installed by me?

I am new to linux and I wanted to know how I can find out if a package was installed by me or by the system at the time of installation ?

1 Like

normally 1 would remember what they installed.

from a system stand point, it’s all installed by the privileged/root user, you know that part where you type in your password.

Open your file system, and look for


These are files created at installation if I recall correctly, and list the packages installed with the system.


looking at man pacman it looks like the command is:
pacman -Qe

hard to tell.

Nope, -Qe is for:

-Q, --query
Query the package database. This operation allows you to view installed packages and their files, as well as meta-information about individual packages (dependencies, conflicts, install date, build date, size). This can be run against the local package database or can be used on individual package files. In the first case, if no package names are provided in the command line, all installed packages will be queried. Additionally, various filters can be applied on the package list. See Query Options below.

-e, --explicit
Restrict or filter output to explicitly installed packages. This option can be combined with -t to list explicitly installed packages that are not required by any other package.

Basically packages explicitly installed (some packages are installed because they are required by something else you install, a dependency, explicitly installed packages may or may not be dependencies for other package, but they are marked as explicitly installed because they are the main target from a pacman command, example pacman -S unrar will explicitly install unrar)

I sometimes wish pacman “Install Reason” contained more than

  • Installed as a dependency for another package, or
  • Explicitly installed

This might help (those files are new to me, so making an assumption here), although it might be easier to just keep a text file with the packages you add/remove and any changes you make to your system, so you could reinstall more easily/quicker if necessary. :slight_smile:

List installed packages that are not part of the Manjaro distribution install (installed by user):

comm -23  <(awk '{print $1}' <(pacman -Q|sort))  <(awk '{print $1}' /rootfs-pkgs.txt /desktopfs-pkgs.txt|sort)

Look at /rootfs-pkgs.txt, /desktopfs-pkgs.txt for distribution packages (not installed by user).

1 Like

How would pacman know any other reason?

All it would know is, did the user request this package, or did a package request this package.

HHHHmmmm, good question :slight_smile:

pacman --sync <PKG> 
# verses 
pacman --sync --refresh --refresh --sysupgrade

sorry, i was on my fire tablet reading the online man page, cause i was laying down for a bit.
sometimes it’s just hard to comprehend man pages.

Thankyou. This is exactly what I was searching for. :slightly_smiling_face:

Thankyou for writing. The command didn’t work properly. It listed packages I know I know I installed. But I did find the solution by checking /rootfs-pkgs.txt /desktopfs-pkgs.txt text files.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.