LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 12-16-2018, 10:03 PM   #1
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 16

Rep: Reputation: Disabled
apt-get autoremove does not remove all dependency


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.

TIA.
 
Old 12-16-2018, 11:13 PM   #2
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
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.
 
Old 12-17-2018, 01:26 AM   #3
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
“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).
 
Old 12-17-2018, 02:56 AM   #4
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Brains, thanks for your input.
So, as per the link shared in my case of scenario, I would need to use aptitude.
 
Old 12-17-2018, 02:57 AM   #5
coolpul
LQ Newbie
 
Registered: Sep 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
What happens if aptitude repo link breaks as during uninstallation, I am installing aptitude first and then uninstalling.
 
Old 12-17-2018, 08:11 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,311
Blog Entries: 28

Rep: Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137
Try

Code:
 apt-get purge [package name]
 
Old 12-18-2018, 02:00 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
coolpul, i think post #3 is the answer and contains the explanation you're looking for.

that, plus discovering the full potential of apt, apt-get, aptitude. by reading the fabulous manual.

in other words, everything works fine, just a little differently.
 
  


Reply

Tags
apt, aptitude, dependencies, uninstall



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how to use 'apt-get autoremove' to remove unnecessary packages Gregg Bell Linux - Newbie 6 12-05-2014 01:44 AM
apt-get autoremove cccc Debian 2 07-26-2009 02:55 PM
apt-get autoremove, LIES!! BigglesPiP Debian 18 01-24-2009 11:22 AM
Significant change caused by apt-get-autoremove, new package, or full disk- which? sonichedgehog Debian 0 02-06-2008 06:36 PM
"apt-get autoremove" in Debian Etch/Sid available? deepclutch Debian 1 12-27-2006 09:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration