Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
It depends how the dependencies were installed. If you installed them explicitly (including via a distro installation script), they will remain. If they came over as dependencies, they will be removed.
It depends how the dependencies were installed. If you installed them explicitly (including via a distro installation script), they will remain. If they came over as dependencies, they will be removed.
Looking at the answers, I think that the word 'dependency' is somewhat ambiguous.
Example: package xyz needs package abc. Then
apt install xyz
will also install abc (of course!)
Uninstalling xyz:
apt remove xyz
will not remove abc, but you can remove it with
apt autoremove (as stated before)
or
apt remove abc
If you want abc to remain:
apt install abc
Uninstalling abc:
apt remove abc
will also remove xyz, logical because xyz cannot function without abc.
You get the change to answer no, if you want xyz to remain.
When you remove/purge a package, all those packages which were automatically installed as dependencies of that package, if they are no longer also dependencies of other packages, will be placed in a list of "packages to be autoremoved" which you can remove with sudo apt autoremove.
However, the package manager is cautious. When a package is uninstalled, any "unused dependencies" of that package which are recommended packages of other still-installed packages will not be added to the autoremove list.
This is my experience anyway, and leads to the occasional behaviour where, in a system where APT is not configured to install both dependencies and recommended packages for a given package, you install a package and it pulls in dependencies, only to uninstall it later and find that not all those dependencies are added to the autoremove list.
But if you use synaptic rather than apt, the left-over dependencies are removed. A lot of people get themselves into a bind as follows:
1) Install a particular desktop. These desktops are "metapackages", empty packages that bring over a load of applications and libraries as dependencies.
2) Try to get rid of an application you don't want. You get a huge list of other packages that will disappear along with it, including a lot of stuff that you actually want to keep.
What has happened? The application you want to remove is a dependency of the desktop package, so that will be removed too. But all the rest of the desktop apps came onto your machine as dependencies of the desktop, so they are also marked for removal.
At this point you have a choice. Either you abort the whole thing, or you must make a list on paper of the apps you want to keep and reinstall them explicitly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.