[SOLVED] How to uninstall software in Debian while handling dependencies correctly?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
How to uninstall software in Debian while handling dependencies correctly?
I tried loading several office suites in Debian. There would be selected components that I didn't need and wanted to uninstall. Mint handles this situation "intelligently", distinguishing dependencies used only by the uninstalled program from those also used by other programs. Debian does not appear to do so. It presents you with a list of dependencies to OK for deletion, but many are used by other programs. It seems to want to delete everything that was associated with the suite if you try to uninstall any piece. I could uninstall just the actual named package. Is there a way to then purge components that are not used by any installed program?
Is there a way to then purge components that are not used by any installed program?
After you remove a package you can get rid of that package's dependencies which are not also used by an existing installed package by using this command:
apt-get autoremove
which removes orphaned packages.
I suggest that you read the man pages for apt-get to make sure that autoremove does exactly what you want.
Thanks for pointing me in the right direction. Looks like I have some reading to do on the variations and options identified from your lead (different tools for different kinds of litter: autoremove, autoclean, localepurge, and deborphan identified so far, along with warnings to take precautions). That's what I was looking for.
Please be aware that the autoremove option can be quite dangerous, especially when it comes to meta-packages.
Metapackages are packages that don't contain any actual software, but have a bunch of dependencies. This mechanism is used to pull in whole software sets, like desktop environments, office suites and so on.
If you remove a part of a software suite installed using such a meta-package the package manager realizes that not all dependencies for that meta-package are installed anymore and will remove it. That causes of course the whole suite to be a dependency that it is not needed anymore, so that an apt-get autoremove call will uninstall the complete suite. While this is annoying when it comes to an office suite it is also very easy to accidentally remove large parts of your OS.
The Debian package manager assumes that you know what you are doing, so make sure to always read the output of apt-get/aptitude before confirming any action and do not confirm if you are in doubt. Debian comes with all the tools you need to determine why a dependency or package is installed, so reading up on this is definitely a good idea, but if in doubt just ask.
Yeah, that "you can totally screw up everything" aspect is a little worrisome. Even doing the "dry run" option to see what would be removed isn't particularly helpful because there is no way to know what the list of removal candidates are used for.
Debian won't ever remove dependencies for other, still installed, packages unless you explicitly tell it to do so, if you mean that.
For general package information Debian offers tools enough for that, for example
Code:
apt-cache depends package
to get the list of dependencies for a package,
Code:
apt-get rdepends package
to get a list of packages that depend on this package or
Code:
apt-cache show package
to get a short description of a package, including dependencies, suggested additional packages, size, ... .
From the binary distributions I deem the APT package management system to be the most flexible and powerful, you just have to know how to handle it properly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.