How to list explicitly installed packages using pamac?

pacman -Qe lists the explicitly installed packages on a system.

Is there a similar command for pamac?

Since pamac also searches AUR, can the pamac command also be used to query explicitly installed packages from AUR?

Thank you.

No it’s not possible ATM.

There is a man page for pamac.

Although you can’t do exactly what you want, there is a column in pamac list -i that shows where a package came from, like AUR. Redirect the output to a file and do a less on it. pamac list -m, showed just the AUR installed packages on my system.

I’ve been looking at pacman -Qi and grabbing the Name and Install Reason, which is either “Explicit” or “Installed as a dependecy for another package”, but there is nothing in the output indicating where (i.e, Repo).

does this help?

Yes, it does.

But what I want to get is a text file listing of the package names.

Can the GUI output be stored as a text file as well: that would suit my purpose ideally.

Thanks.

What you can do in the GUI, you can do at the command line (see man pamac).

# List installed packages
pamac list --installed

# Pipe output to awk and print the first field and redirect stdout to file
pamac list --installed | awk '{print $1}' > installed-files

Thanks, @stargazer

How do I find “explicitly installed” packages using pamac on the command line?

It’s not yet possible but I will add it in a next release

1 Like

This command can display packages installed through AUR

pamac list -i | grep AUR

and this command can save the list to a file

pamac list -i | grep AUR > aur_packages.txt
1 Like

HHHhmmm. There’s pacman until pamac cli gets it.

I checked the code to see if it matched the man page. It does.

Here’s an interesting item. In the pamac source code directory there is an examples/python directory. There is an example, list_installed_pkgs_async.py, which when executed creates a list of all installed packages. You can replace the two calls (line 9 and line 19) which contain get_installed_pkgs_async to get_explicitly_installed_pkgs_async. The method can be seen in the src/database.vala file. I compared the output to pacman -Qe and it’s the same.

If you list explicitly installed packages with pacman, it should also list AUR packages that are installed.

It does for me.

So pacman -Qe will list all explicitly installed packages, no matter if it’s from repo, AUR or even self built. As long as it’s a package file that uses libalpm.

pacman -Qet is probably a bit better than just -Qe for people looking for explicitly installed packages as it produces a shorter list, which only prints

packages neither required nor optionally required by any currently installed package.

(from man pacman)

But the more comprehensive result is definitely pacman -Qe, particularly if you’re looking to free up as much storage space as possible. Just posting this option for people who didn’t want to peruse the whole manpage :slight_smile:

Added in pamac 10.1.0 :wink:
pamac list -e

3 Likes

Thank you.

I will try it out once it is rolled out. At present:

pamac --version
Pamac  10.0.5-1