You are not logged in.

#1 2013-06-25 08:28:31

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

List no longer used programs/packages

Hi there,

Due to the filesystem on root being almost full I will have to clean up the list of installed packages. No I am wondering if there is any way to list packages in descending order of their last usage. By that this would give me an insight on which packages and programs have not been used for a long time and thus could be uninstalled.

Is this possible with pacman by default or are there any scripts out there that would allow me to list packages according to their last usage?

Thanks!

Offline

#2 2013-06-25 08:37:29

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: List no longer used programs/packages

No such timestamp exists. You should simply show all explicit packages and filter out groups like base, base-devel, xorg and your desktop, then see what you don't need anymore.

Offline

#3 2013-06-25 09:09:34

swanson
Member
From: Sweden
Registered: 2011-02-05
Posts: 759

Re: List no longer used programs/packages

Also check /var/cache/pacman/pkg for doubles. cacheclean in the AUR can do it for you.

Offline

#4 2013-06-25 09:30:48

SidK
Member
Registered: 2011-03-03
Posts: 116

Re: List no longer used programs/packages

Depending on your mount options, you can do something like:

stat /usr/bin/* | awk ' /^  File:/ {n=$2} /^Access: 2/ {d=$2 ; print d "\t" n}' | sort -rn

I'm aware that that will only search /usr/bin, I'm just giving you a starting point. This will give you a list of files not recently accessed, from there you can find which package owns that file and remove it. However note that often you use a package in other ways. For instance the last item the above gives me is:

2012-08-22	‘/usr/bin/aspell’

However, I know that I'm using the aspell libraries, even if not the executable directly.

Hmm.... Looking at my own results, /usr/bin/id3 shows is as late 2012 when I know I've used it more recently. Ah, I mount the root partition with noatime. Yeah, as I said at the start, this depends on your mount options.

Offline

#5 2013-06-25 09:33:54

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: List no longer used programs/packages

Thanks for your replies. I especially like your idea SidK!

Do you see any possibility to also taking into account indirect usage of files, such as mentioned with aspell libraries?

Offline

#6 2013-06-25 09:34:56

jakobcreutzfeldt
Member
Registered: 2011-05-12
Posts: 1,042

Re: List no longer used programs/packages

$ grep "\[PACMAN\] installed" /var/log/pacman.log

Edit: Nevermind, "last usage" not "last install"

Last edited by jakobcreutzfeldt (2013-06-25 09:36:39)

Offline

#7 2013-06-25 09:50:35

SidK
Member
Registered: 2011-03-03
Posts: 116

Re: List no longer used programs/packages

orschiro wrote:

Thanks for your replies. I especially like your idea SidK!

Do you see any possibility to also taking into account indirect usage of files, such as mentioned with aspell libraries?

Not using this method, no. You're starting to sound a little like a help vampire, have you done any of your own research?

Going back to the problem (as opposed to trying to implement your propsed solution); have you tried listing pacman's packages by size and seeing if you can get any quick wins by removing large ones?

Offline

#8 2013-06-25 10:18:46

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: List no longer used programs/packages

I used a similar oneliner to SidK's but for all files, not only binaries: logs, cached content (e.g. package cache) etc. can take up a lot of space too.

Offline

#9 2013-06-25 14:31:12

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: List no longer used programs/packages

pacsysclean will list packages in order of size. Maybe there is a few big packages that you don't use anymore.

Offline

#10 2013-06-25 16:02:29

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: List no longer used programs/packages

Awebb wrote:

No such timestamp exists. You should simply show all explicit packages and filter out groups like base, base-devel, xorg and your desktop, then see what you don't need anymore.

Double this.  If in looking at a complete list of explicitly installed packages you can't tell what you do and do not use, you installed way too much in the first place; having to uninstall them piecemeal is your lesson in keeping things clean..  You can always use "pacman -Si <package>" to view info on a package, and "pacman -Rncs" to see what packages might be pulled out should you uninstall something.

Offline

#11 2013-06-26 05:13:24

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: List no longer used programs/packages

Thanks for all your solutions. I really appreciate it. I ended up with the combination of cacheclean and pacsysclean which allowed me to identify the largest packages, manually selecting which ones I do no longer use, and purging the cache very nicely.

Offline

Board footer

Powered by FluxBB