Jump to content

rpm question that just came into my mind


arctic
 Share

Recommended Posts

I just had a thought. When I install rpms with e.g. urpmi or apt-get or smart or ..., usually a lot of dependencies are met and other packages get installed, too. Now, let's say, I want to test some applications. I play around with them but after some weeks I forget about it and uninstall the apps. Now most of the rpms that were installed for meeting the dependencies are still installed as usually only the base app is removed. This blows up my system and uses up some "pretty" harddisk space. B)

 

Twelve months later. My system is filled with unused rpms, but I can't remember which rpms are now "useless" on my system. Is there a command that can be launched for checking/scanning the system which rpms haven't been used in e.g. 2 months or one year, so I get a list of stuff I can uninstall? Or is there a command/script one could use for automatically removing rpms that were not used by the system in any way for a specified amount of time like e.g. one year? Or something similar?

 

:juggle:

Link to comment
Share on other sites

Is there a command that can be launched for checking/scanning the system which rpms haven't been used in e.g. 2 months or one year, so I get a list of stuff I can uninstall?

This won't do exactly what you want, but it still may provide some useful info.

 

Using the find command, there is a way to determine which files were last accessed more than x days ago. Since the find command can also apply another command to the results, we can use urpmf to then find what package the file was installed from.

 

For example, if I want to see what files in /usr have not been accessed for at least the past 180 days, I could run the following command which will display the package plus the file name.

 

find /usr -atime +180 -exec urpmf {} \;

 

Example of what the above might output:

printer-filters:/usr/share/doc/printer-filters-10.2/AppleStyleWriter/README.troubleshooting
printer-filters:/usr/share/doc/printer-filters-10.2/AppleStyleWriter/Makefile.atalk

Note: If you use the noatime option in fstab, then the system does not update access time and the above won't work.

Edited by jboy
Link to comment
Share on other sites

Arch's pacman does that:

pacman -Rs useless

Removes the package "useless", as well as all it's dependencies which aren't needed by other packages. Of course all will be listed, so you can checkout if you actually need any of them...

Pacman does way more than that, but I guess this isn't enough to convince you trying Arch Linux (or Frugalware, which also uses pacman...) :P

Link to comment
Share on other sites

Ummm... I was just curious if anyone ever thought of what I explained earlier. I don't really want to change distros right now (I have a stockpile of distros running here) only because of that feature. I thoughta solution to such a "problem" could be useful for some people...

 

BTW: I do have arch on a cd here. I simply haven't found the time yet to play around with it. Yoper bug-testing is more important for me and my co-developers at Yoper right now. ;)

Link to comment
Share on other sites

/usr/bin/package-cleanup  --leaves

 

part of yum-utils

 

 /usr/bin/package-cleanup
usage: package-cleanup [options]

options:
 -h, --help           show this help message and exit
 --problems           List dependency problems in the local RPM database
 --leaves             List leaf nodes in the local RPM database
 --all                When listing leaf nodes also list leaf nodes that are
                      not libraries
 --orphans            List installed packages which are not available from
                      currenly configured repositories.
 -q, --quiet          Print out nothing unecessary
 -y                   Agree to anything asked
 --oldkernels         Remove old kernel and kernel-devel packages
 --count=KERNELCOUNT  Number of kernel packages to keep on the system
                      (default 2)
 --keepdevel          Do not remove kernel-devel packages when removing
                      kernels
Please specify either --problems, --leaves, --orphans or --oldkernels

 

edit: added options

Edited by cybrjackle
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...