DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Happened to notice that apt isn't removing dependencies correctly.
Wanted to run deborphan, so I did an apt-get install deborphan. It said it also wanted to install dialog as a dependency. Fine, so I let it install both of them. No problems.
Ran deborphan, looked at the results, and then didn't need it anymore so I did an apt-get --purge remove deborphan. Well, it removed deborphan fine, but dialog is still there. There was nothing else that depended on dialog before I installed deborphan (it wasn't already installed prior to this), and now that deborphan is gone, how come it didn't remove dialog as well, as there is nothing else depending on it.
I thought apt handled dependencies better than this. This seems like one really fast way to crud up your system with lots of unnecessary leftovers real quick.
What am I missing here ? Is something messed up with my dependency tree ? Maybe someone could try this out and let me know what you get.
that's what deborphan is for, not to crud up your system I don't know about dialog though. here something handy for future references
[code]
deborphan|xargs apt-get -y remove --purge
[\code]
that will remove everything deborphan finds. Sorry I couldn't be of more help
Thanks for the replies. I probably used a bad example with deborphan, because as was said, its purpose is to help keep your system crud-free , and actually my problem is much more general than just with deborphan.
Let me restate my problem in perhaps a better way. When I install program "X" using apt-get, and it also wants to install some dependencies "Y" that I don't already have, and after I do the installation, if I turn around and immediately do an apt-get remove, it will only remove "X", and not "Y", even though nothing else is depending on "Y". What's up with that ?
I just used deborphan as an example, because it was simple, and it only wanted to install one dependency that I didn't already have on my system.
Figured it out. Partly a problem with me, and partly a problem with how apt handles dependencies when you remove a package.
My problem was how I interpreted this line from the apt documentation: "APT also takes care of removing packages which depend on the package you have asked to remove. There is no way to remove a package using APT without also removing those packages that depend on it."
Once I understood that, I went back to my example and did an apt-get remove dialog first, and then it would remove both dialog and deborphan automatically, even though my original install was only of deborphan.
But, this also brings up a bigger question. Are there some package utilities out there that handle the dependencies of removing packages better ? The way apt works, it's necessary to know the highest level dependency in order to completely undo a package install. Otherwise, simply doing apt-get install "X", which then also installs "Y" dependencies (which is excellent by the way, yea Debian), will leave you hanging with a bunch of possibly unused packages when you go back and apt-get remove "X", as it doesn't know if it's the only user of the "Y"s, and doesn't remove them, like in my first post.
I don't know why apt does that. Deborphan, and orphaner will clean up all packages that aren't needed anymore. Yes, it is completely safe(as far as I know) to remove everything deborphan finds
Yes, it is completely safe(as far as I know) to remove everything deborphan finds
Depends on your definition of safe. If you have 3rd party software installed you may end up removing something they depend on. For example, I have the Citrix ICA client installed on my machine which uses libxaw7 but the package manager has no idea about that relationship.
Now THAT rocks! Thanks for that thread post. Aptitude is where I'm headed....
After reading more in this forum and elsewhere about Aptitude, I like its features a bunch. For those interested, see this also, reference a link in an earlier post by Dead Parrot:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.