Is there any way you can list recently installed explicit packages. I installed some packages recently while trying out something, there were quite a few of them from a script. Now, I want to remove those recently installed packages. I know I can go through the log and manually see packages that have been installed but that’s time consuming. Is there a better way to list recently installed explicit packages so I can remove them.
I think it’s
pacman -Qe
You can look this up with man pages.
man pacman
Looking for “recently” installed explicit packages not all explicit packages.
with the following commands you can list updated/installed packages.
expac --timefmt='%Y-%m-%d %T' '%l\t%n'|sort -n
with this cammand you list only the last 10 packages, you can change the value as you wish.
expac --timefmt='%Y-%m-%d %T' '%l\t%n' | sort | tail -n 10
Unfortunately, I can’t tell you how you can only display packages that you installed yourself(recently). But I would also be interested to know how it works.
Here is a quick and dirty way based on @pycrk’s command above:
expac --timefmt='%Y-%m-%d %T' '%l\t%n %w' | sort | tail -n 30 | grep "explicit$" | awk '{print $3}'
EDIT:
I think this is better as it puts the most recent ones at the top:
expac --timefmt='%Y-%m-%d %T' '%l\t%n %w' | sort -r | head -n 30 | grep "explicit$" | awk '{print $3}'
if you gang-installed (script) in one session like it sounds you did, this should be evident in any log. cut and paste then gang-remove.
if it’s not that easy this https://unix.stackexchange.com/questions/409895/pacman-get-list-of-packages-installed-by-user and https://unix.stackexchange.com/questions/3595/list-explicitly-installed-packages has more variations on dialing in explicits that Rick and pyrck gave you.
so we’re clear the linux definiton of explicit that I’m seeing means any package not installed by system in original install or rolling update: stuff that you pick and chose to install outside repo.
Which to me means flatpak (incidentally), AUR, and any /.sh
install script you run after cracking a tarball or straight from git
…there’s probably more ways than that…
hope the articles are valuable they both deal with exctly what you are talking about. in linux it seems there are a dozen ways to skin a cat
edit: didn’t edit/changed mind
I’m talking about explicit as in pacman’s explicit package.
The command I gave you is limited to only pacman’s explicit packages.
I was replying to that other guy.
Your both commands give out packages but those were not installed recently.
You may be thinking of foreign packages.
Explicitly installed packages are the ones you actually list out with the install command.
sudo pacman -S package_A
package_A
is explicitly installed.
If package_A
pulls in package_B
and package_C
as dependencies, package_A
is explicitly installed but package_B
and package_C
are not.
Did the script install the packages with Pacman, or something else? If you can share the script that may be helpful.
outstanding explanation, thank you. since I’ve never head the term before yesterday, I followed a ubuntu superuser thread and some peeps explained that it was every non-repo, non-local package (outside installs) you personally do…this definition runs directly counter to yours. not even your excellent package_B and package_C elaborations were in there.
that’s on me for not reading more than one article before I accepted that initial definition. I am usually more careful than that. appreciate the explanation.
Actually, there were some packages in the script which were already installed as explicitly so its that I’m not sure to remove all the packages that were in the script.
That’s why, was looking for a way to list the recently installed explicit packages so I could remove them.
Anyway, I did that manually but a command or script for it would be helpful.
Explicit packages are packages that are fed to pacman as -S.
pacman -S packagename
This is an explicit package.
any post-installation packages added via local repos (-S
) are known as explicit. Got it, and thanks. Is it exclusive to pacman
? Or is a yay -S
also explicit?
yay
calls pacman
to install the package so it is exactly the same.
You are right, in linux there’s more than one way to skin a cat but there’s more than one way to nuke your system too so gotta be careful.
But again, a person learns from mistakes.