I have just been updating my Debian Squeeze box and noticed that it wanted to update apache2.2-bin. I can't think of any reason why I need apache on that box, it's not used as an http server, so I go to remove it...

What?! Why on Earth is Gnome in any way dependent on Apache, or vice versa? It seems to me that it might have something to do with user sharing? But really, my Ubuntu box doesn't need Apache installed in any way.I might point out that Debian also suggests this little list should be removed using apt-get autoremove...

The packages gnome and gnome-desktop-environment are metapackages, i.e. packages containing no code but just a list of dependencies. They are used by Debian to simplify the installation of a related group of packages. You can safely remove them with no effect on your system. I don't know why Apache is a dependency of gnome, but you can certainly uninstall it with no issues.

From what I've read, I suspect Apache is needed for gnome-user-share, then this is listed by one of the metapackages. But still, I don't see why uninstalling metapackages should render the other packages as unrequired, that seems arse-about-face to me. It obviously isn't essential to do it this way as Ubuntu 10.04 doesn't.

Presumably the autoremove list is in effect all the dependencies of the two metapackages which are being deleted. It might be argued that Debian's apt-get is being quite smart in offering to treat the metapackages this way.

Two suggestions:

1. Install synaptic and use that for package installation and removal. Its defaults are more benign in instances like this - you can delete a metapackage without any alarms.

2. Use aptitude instead of apt-get. Squeeze was released at the time when Debian was in a bit of a changeover state, but now with Testing, aptitude has become the preferred package management utility. Its algorithms are a bit different and rather more subtle.

root@aglaia:/home/rhakios# aptitude remove apache2.2-binThe following packages will be REMOVED: apache2.2-bin 0 packages upgraded, 0 newly installed, 1 to remove and 1 not upgraded.Need to get 0 B of archives. After unpacking 3,469 kB will be freed.The following packages have unmet dependencies: gnome-user-share: Depends: apache2.2-bin but it is not going to be installed. libapache2-mod-dnssd: Depends: apache2.2-bin but it is not going to be installed.The following actions will resolve these dependencies:

I'm beginning to think that this could be something to do with the way the gnome metapackages are constructed then. I use Debian Testing with KDE, so it's not directly comparable to your situation, but I can remove metapackages with none of the problems you've seen.

Indeed, I think they've got the dependencies running both ways. I'll spare you the verbose output, but if I try to remove gnome-desktop-environment, then it says it'll need to remove gnome as well, and if I remove gnome then pretty much everything else gets called too. Ho hum.
Looks like I'll be leaving Apache in place, httpd isn't running, so it's not really doing anything worse than wasting a few megabytes of disk space. Still, it's slightly annoying.

I can honestly say that in well over four years of using Debian on several different systems I've never experienced this issue. I often have occasion to remove metapackages, and it works just like I mentioned above. The only explanation I have, improbable though it may sound, is that the gnome metapackages are built so as to deliver this two-way dependency issue, but the KDE metapackages aren't.