12

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 2

11

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. [...]
6
  • air? err, surely.
    – TRiG
    Nov 9, 2010 at 12:57
  • 1
    Yes, but if I'd correct it, it wouldn't be a quote anymore. :P
    – htorque
    Nov 9, 2010 at 13:08
  • 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
  • 1
    Though when he fixes it in the next comment, I think you can adjust the quote. :)
    – Roger Pate
    Nov 11, 2010 at 17:59
  • 1
    This 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?
    – Albert
    Dec 30, 2021 at 13:26
2

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!

4
  • don't try this answer with latest Willy. You'll get screwed Apr 14, 2016 at 18:02
  • @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 installs I've done. Pretty clean dependency management I'd say.
    – ulidtko
    Apr 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 by unmarkauto 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.
    – ulidtko
    Apr 15, 2016 at 11:09

You must log in to answer this question.

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