yum: getting rid of everything that got installed from that install
September 4, 2008
So, we’ve all been in this situation. You install something you hadn’t seen before. It pulls in the world in dependencies. You use the program for a little while and you realize that you don’t really want it anymore. You run ‘yum remove whatever’ and it removes just whatever. But you know all the deps it pulled in are still installed dirtying up your system.
I wrote this today in response to a thread on fedora-devel-list:
http://skvidal.fedorapeople.org/misc/yum-remove-with-leaves.py
You run it as:
yum-remove-with-leaves.py name_of_package
Then it will remove that package and the deps that it pulled in that are not in use by anything else.
It works reasonably well. Let me know what you think.
September 4, 2008 at 11:34 pm
This should definitely be a plugin to yum (or even in yum).
Something like a –with-leaves option…
package-cleanup is great, but having an easier and faster way to just remove all leaves after an install you don’t want anymore is just awesome !
The only thing that is preoccupying me is that people will tend to use it always (like the -y option), introducing a lot of overheaded in downloading packages several times, installing / removing / installing / … the same package, etc.
September 5, 2008 at 12:05 am
Cool! I’ve wondered about these leftovers before. This looks very helpful.
September 5, 2008 at 12:20 am
I’m looking forward to this being part of yum proper.
Saves me from copy and pasting the dependencies and saving them to a text file for future ‘complete’ removal.
Thanks
September 5, 2008 at 3:41 am
It looks promising. The ability to do this kind of thing has been in Debian (and its kids) for a while because Apt tracks automatically installed packages. So it’s good that you’re addressing the problem in Yum in some way, even if it isn’t initially at the core of yum. Perhaps an approach similar to Apt’s would reduce the level of loop nesting you have there? (I’m not looking for a cross-distro flamewar, I just think they got this problem solved nicely in Apt).
September 5, 2008 at 5:22 am
very nice, a good candidate to go into yum-utils or maybe in yum core.
September 5, 2008 at 1:37 pm
I agree, this is a great feature and should be part of yum by default. Like Tim says above, on Debian/Ubuntu the aptitude command has this by default so when you uninstall a package, all dependencies go with it. No fuss, no muss.
Just do it 🙂
September 6, 2008 at 7:33 pm
Very nicely done, and useful when I need to get rid of ${OTHER_DE} applications that I’ve installed for specific trial or data exchange purposes.
September 6, 2008 at 9:38 pm
APT doesn’t track automatically-installed packages, only aptitude does, and if you use apt-get or dpkg directly, you confuse aptitude.
September 17, 2008 at 6:22 pm
Kevin, I’m afraid your information is out-of-date. apt has groked automatically installed packages since June 2007: http://lists.debian.org/debian-devel/2007/06/msg00379.html
apt and aptitude have played nicely together ever since then.