enter image description here

as can be seen from the screenshot, I installed checkinstall and it came with lots of new dependent packages.

When I ran:

sudo apt-get purge checkinstall

only checkinstall was deleted. I then ran:

sudo apt-get autoremove

to delete the new packages but nothing was deleted.

Any ideas what I could be doing wrong? Thanks

PS. please ignore the folder ubuntu. it's just a directory name. I'm really using Stretch

edit1: output of aptitude why binutils build-essential

enter image description here


1 Answer 1


By default, apt-get autoremove is very conservative, which results in the behaviour you’re seeing. While apt-get install only considers direct dependencies and recommendations by default, apt-get autoremove also considers suggestions (very weak dependencies). This is asymmetric and means that by default, apt-get autoremove won’t necessarily fully undo a package installation.

Thus in your case, installing checkinstall pulled in a number of packages, all of which end up somehow considered non-removable by apt-get autoremove; for example, build-essential is kept because apt (which is definitely necessary) suggests dpkg-dev, which recommends build-essential. You’ll find relationships of this kind for every package pulled in by checkinstall.

To fix this, you can add

Apt::AutoRemove::SuggestsImportant "false" ;

With this setting, apt-get autoremove will find more packages to remove. Since your system is newly installed, it should be safe (by that I mean that the asymmetry mentioned above won’t cause many surprises, because you haven’t installed many packages); but do examine the list of packages it’s going to remove before actually removing them!

  • I added the line in /etc/apt/apt.conf and then was able to remove g++ that was installed automatically when installing VirtualBox from Debian Fast Track. However apt autoremove still does not uninstall other packages installed automatically like libasan8 that are no longer needed, any idea why?
    – baptx
    Mar 6 at 20:37
  • @baptx not with only that information ;-). aptitude why libasan8 will tell you why libasan8 is kept installed on your system. If that doesn’t clarify the situation, feel free to ask a new question with more details. Mar 7 at 6:23
  • I asked the question here: unix.stackexchange.com/questions/771812/…
    – baptx
    Mar 7 at 12:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .