LinuxQuestions.org
Review your favorite Linux distribution.
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, 11: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-17-2018, 12:13 AM   #2
Brains
Member
 
Registered: Apr 2009
Distribution: Debian testing
Posts: 987

Rep: Reputation: 260Reputation: 260Reputation: 260
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, 02:26 AM   #3
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,716

Rep: Reputation: 554Reputation: 554Reputation: 554Reputation: 554Reputation: 554Reputation: 554
“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, 03: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, 03: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, 09: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: 15,875
Blog Entries: 27

Rep: Reputation: 4667Reputation: 4667Reputation: 4667Reputation: 4667Reputation: 4667Reputation: 4667Reputation: 4667Reputation: 4667Reputation: 4667Reputation: 4667Reputation: 4667
Try

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

Rep: Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655Reputation: 3655
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:44 AM
apt-get autoremove cccc Debian 2 07-26-2009 03:55 PM
apt-get autoremove, LIES!! BigglesPiP Debian 18 01-24-2009 12:22 PM
Significant change caused by apt-get-autoremove, new package, or full disk- which? sonichedgehog Debian 0 02-06-2008 07:36 PM
"apt-get autoremove" in Debian Etch/Sid available? deepclutch Debian 1 12-27-2006 10:20 AM

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

All times are GMT -5. The time now is 05:30 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration