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.
OS: Ubuntu-18.04.1
I have a condition where I install using command "apt-get install package_name" which installs the package along with all the dependencies.
Now, when I am trying to uninstall the same package using command "apt-get autoremove --purge package_name" which uninstalls most of the dependencies but not all.
When I try to uninstall package using aptitude command, it is working fine.
E.g. Uninstalling using apt-get autoremove uninstalls 51 dependencies (not removing all dependencies) but uninstalling using aptitude uninstalls 58 dependencies (which is correct).
Any idea where I am going wrong with apt-get autoremove command or any help.
I use aptitude by default, but I'm also old school when it was just better. There has been many changes over the years. There are also lots of different opinions on the difference between the two, but this answer does sounds more like how I remember the differences.
“apt-get autoremove” is a standalone command that removes ‘orphaned’ auto-installed packages.
AFAIK using it in the way you have, doesn’t apply it to the dependencies of the package you are purging (as you might imagine), but simply runs it as well as the purge operation, and the result is probably dependant on the order things happen during the apt-get session. Does a subsequent ‘apt-get autoremove’ clean up the leftovers?
In contrast, aptitude, by default, removes dependencies as well (so long as they aren’t also depended on by other packages).
Also, it’s dependency resolution is considerably smarter than apt-get, but that could also be a disadvantage in some situations (e.g. dist-upgrades where apt-get is the recommended tool).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.