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
Best Answer
By default,
apt-get autoremove
is very conservative, which results in the behaviour you’re seeing. Whileapt-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 byapt-get autoremove
; for example,build-essential
is kept becauseapt
(which is definitely necessary) suggestsdpkg-dev
, which recommendsbuild-essential
. You’ll find relationships of this kind for every package pulled in bycheckinstall
.To fix this, you can add
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!