2

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

  • 3
    Presumably something else recommends the packages you installed (see Why did 'apt-get autoremove' not work properly?). What does aptitude why binutils build-essential say? – Stephen Kitt Sep 25 '17 at 15:10
  • @StephenKitt If something else recommended it, wouldn't it be installed already? – Faheem Mitha Sep 25 '17 at 15:22
  • Just checking, Is there any possibility that you installed them manually?, something like apt install binutils etc... – Thushi Sep 25 '17 at 15:57
  • 3
    @Faheem not necessarily; there are a number of scenarios that can lead to this situation. For example, a package might have acquired a recommends since it was installed (upgrades don’t install recommended packages); or perhaps the packages installed here have a recommend loop. – Stephen Kitt Sep 25 '17 at 16:20
  • @StephenKitt new Debian install. The only packages I manually installed are git, sudo and checkinstall (installed in this order). binutils/build-essential were needed by checkinstall. I'm getting the same issue. I edited the 1st post to display output of aptitude why package-here. Thanks! – mrjayviper Sep 26 '17 at 1:18
3

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!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.