I just installed Maverick and was surprised that almost all packages are marked as manually installed (linux-headers and wireless-crda aren't). Doesn't that defeat the purpose of the differentiation between automatically and manually installed packages?
2 Answers
Seems my Google powers were weakened: this is a known bug (concentrate on comments from Colin Watson) and it's hanging around for some time with no fix in sight:
Quoting Colin Watson:
[...] Leaving all packages as manually installed is unsightly but the consequences of this bug are generally limited to not managing to be clever enough to remove packages that aren't needed any more. A flaw in the reverse direction would be much worse, because it could cause packages to be removed when they are still needed. Given that there does not seem to be a clearly correct fix available, it's better to air [sic] on the side of caution. [...]
-
-
1
-
What I wonder is : since this "manually installed" section is obviously irrelevant (unusable), why don't they just hide it ? No need to display it if you can do nothing with it... which seems to be the case in my point of view. Then if they get a fix someday, they can show it again. This has been in Ubuntu since Jaunty or Karmic if I remember well... Nov 10, 2010 at 7:17
-
1Though when he fixes it in the next comment, I think you can adjust the quote. :)– Roger PateNov 11, 2010 at 17:59
-
1This is an old bug report from 2009 with the latest comment from 2014. I asked a related question recently, and there is one answer which has some statistics which indicate this problem is fixed in Ubuntu 20.04?– AlbertDec 30, 2021 at 13:26
Okay, now this is the first thing I do right after installation. I mark (almost) every package as automatically installed, and they stay as dependencies of ubuntu-desktop
:
apt-mark showmanual | xargs sudo apt-mark auto
sudo apt-mark unmarkauto ubuntu-desktop
Ideally, that would be enough. But as per Colin Watson, the world isn't so perfect, and we need some more polishing. Iterate:
apt-get autoremove --simulate
# ...
# output of what's to be autoremoved
sudo apt-mark unmarkauto <package>
where <package>
for me ends up at least as each of ubuntu-standard
, ubuntu-minimal
, ubuntu-restricted-addons
. Also some language packs.
Worth noting is also aptitude
, which with its TUI can aid the process.
Having done this, my system's package manager reports look so much more pleasant and comprehensible:
$ apt-mark showmanual
aptitude
dkms
git
subversion
ubuntu-desktop
ubuntu-minimal
ubuntu-restricted-addons
ubuntu-standard
vim
zsh
Voila!
-
-
@StefanoMtangoo I've done this on wily myself. Right now I have 97 packages marked manual, and 2455 packages marked auto. Those 97 represent pretty much accurately all the
apt-get install
s I've done. Pretty clean dependency management I'd say.– ulidtkoApr 15, 2016 at 9:12 -
I did it and all I got is almost all packages were set to autoremove and had to go thru pain of removing and installing back...not very good experience Apr 15, 2016 at 10:43
-
1@Stefano, did you notice I described a loop of
autoremove --simulate
followed byunmarkauto
of hand-picked umbrella packages? That's the key. You're not supposed to actually remove and install back the packages. All the changes you do to the system consist of marking packages as installed manually, or automatically -- as a dependency (often indirect) of some other manually installed package.– ulidtkoApr 15, 2016 at 11:09