Debian – Why does removing Iceweasel nuke GNOME

aptdebiangnomeiceweasel

I hav an older Debian 7 VM for testing. I'm trying to reduce VM footprint size because I am about out of space. I wanted to remove Iceweasel since I don't really use it, and I can usually get by with wget. When I ran Apt it told me it was removing GNOME, too:

$ sudo apt-get remove iceweasel*
...

The following packages were automatically installed and are no longer required:
  hyphen-en-us libfs6 task-desktop x11-apps x11-session-utils x11-xfs-utils
  xinit xorg
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  icedove iceowl-extension
Suggested packages:
  apparmor calendar-google-provider
The following packages will be REMOVED:
  gnome gnome-core iceweasel task-gnome-desktop
The following NEW packages will be installed:
  icedove iceowl-extension
0 upgraded, 2 newly installed, 4 to remove and 0 not upgraded.
Need to get 44.7 MB of archives.
After this operation, 100 MB of additional disk space will be used.
...

Why does removing Iceweasel nuke GNOME?


After removing Iceweasel and then making an autoclean and autoremove pass, this was presented. I'm fairly certain this VM has been rendered useless.

The following packages will be REMOVED:
  aisleriot ant ant-optional argyll at-spi2-core baobab browser-plugin-gnash
  ca-certificates-java caribou caribou-antler cheese dconf-tools default-jre
  default-jre-headless empathy empathy-common espeak-data file-roller finger
  fonts-cantarell fonts-opensymbol fonts-sil-gentium fonts-sil-gentium-basic
  gcalctool gdebi gdm3 gedit gedit-common gedit-plugins gir1.2-atspi-2.0
  gir1.2-gdata-0.0 gir1.2-gnomekeyring-1.0 gir1.2-goa-1.0 gir1.2-gtop-2.0
  gir1.2-gucharmap-2.90 gir1.2-javascriptcoregtk-3.0 gir1.2-rb-3.0
  gir1.2-tracker-0.14 gir1.2-webkit-3.0 gir1.2-wnck-3.0 glchess glines gnash
  gnash-common gnect gnibbles gnobots2 gnome-backgrounds gnome-color-manager
  gnome-dictionary gnome-disk-utility gnome-documents gnome-font-viewer
  gnome-games gnome-games-data gnome-games-extra-data gnome-icon-theme-extras
  gnome-mag gnome-nettool gnome-orca gnome-packagekit gnome-packagekit-data
  gnome-screenshot gnome-shell-extensions gnome-sudoku gnome-system-log
  gnome-tweak-tool gnome-video-effects gnomine gnotravex gnotski gnuchess
  gnuchess-book grilo-plugins-0.1 gtali gucharmap guile-2.0-libs
  hamster-applet hyphen-en-us iagno icedtea-6-jre-cacao icedtea-6-jre-jamvm
  icedtea-netx icedtea-netx-common inkscape iputils-tracepath java-common
  libapache-pom-java libatk-adaptor libatk-adaptor-data libatk-bridge2.0-0
  libatk-wrapper-java libatk-wrapper-java-jni libatspi1.0-0 libatspi2.0-0
  libavahi-gobject0 libavahi-ui-gtk3-0 libblas3gf
  libboost-program-options1.49.0 libboost-thread1.49.0 libcaribou-gtk-module
  libcaribou-gtk3-module libcmis-0.2-0 libcolamd2.7.1 libcolorblind0
  libcommons-beanutils-java libcommons-collections3-java
  libcommons-compress-java libcommons-digester-java libcommons-logging-java
  libcommons-parent-java libdb-java libdb-je-java libdb5.1-java
  libdb5.1-java-jni libdee-1.0-4 libdiscid0 libdmapsharing-3.0-2 libdotconf1.0
  libespeak1 libexttextcat-data libexttextcat0 libfs6 libgail-common
  libgdict-1.0-6 libgdict-common libgdu-gtk0 libgeocode-glib0 libgexiv2-1
  libgnome-mag2 libgpod-common libgpod4 libgraphite2-2.0.0 libgrilo-0.1-0
  libgtk-vnc-2.0-0 libgupnp-av-1.0-2 libgupnp-dlna-1.0-2 libgvnc-1.0-0
  libhsqldb-java libhyphen0 libicc2 libicu4j-java libimdi0 libjaxp1.3-java
  libjline-java libjtidy-java liblinear-tools liblinear1 liblouis-data
  liblouis2 liblucene2-java libmagick++5 libminiupnpc5 libmtp-common
  libmtp-runtime libmtp9 libmythes-1.2-0 libnatpmp1 libplot2c2 libpstoedit0c2a
  libraw5 libregexp-java libreoffice libreoffice-base libreoffice-base-core
  libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw
  libreoffice-emailmerge libreoffice-evolution libreoffice-filter-binfilter
  libreoffice-filter-mobiledev libreoffice-gnome libreoffice-gtk
  libreoffice-help-en-us libreoffice-impress libreoffice-java-common
  libreoffice-math libreoffice-report-builder-bin libreoffice-style-galaxy
  libreoffice-style-tango libreoffice-writer librhythmbox-core6 libsctp1
  libservlet2.5-java libsofia-sip-ua-glib3 libsofia-sip-ua0 libsonic0
  libspeechd2 libstlport4.6ldbl libsvm-tools libtelepathy-farstream2
  libunique-3.0-0 libvisio-0.0-0 libwnck-common libwnck22 libwpd-0.9-9
  libwpg-0.2-2 libwps-0.2-2 libxalan2-java libxerces2-java
  libxml-commons-external-java libxml-commons-resolver1.1-java libxss1
  libxz-java lightsoff lksctp-tools lp-solve mahjongg media-player-info
  minissdpd mobile-broadband-provider-info mythes-en-us network-manager-gnome
  nmap openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib openjdk-7-jre
  openjdk-7-jre-headless p7zip-full perlmagick pstoedit python-brlapi
  python-louis python-mako python-markupsafe python-pyatspi python-pyatspi2
  python-speechd python-uno python-wnck python-zeitgeist quadrapassel rdesktop
  rhythmbox rhythmbox-data rhythmbox-plugin-cdrecorder rhythmbox-plugins rygel
  rygel-playbin rygel-preferences rygel-tracker seahorse shotwell
  shotwell-common simple-scan sound-juicer sound-theme-freedesktop
  speech-dispatcher swell-foop task-desktop telepathy-gabble telepathy-idle
  telepathy-logger telepathy-rakia telepathy-salut transmission-common
  transmission-gtk ttf-liberation ttf-sil-gentium-basic tzdata-java uno-libs3
  unoconv ure vinagre vino x11-apps x11-session-utils x11-xfs-utils xbrlapi
  xdg-user-dirs-gtk xfonts-mathml xinit xorg xul-ext-adblock-plus
  zeitgeist-core
0 upgraded, 0 newly installed, 278 to remove and 0 not upgraded.

Best Answer

As others have explained, the desktop meta-packages — such as task-desktop or gnome-core — install a web browser nowadays (well, for quite a long time actually). You might expect gnome-core to install Epiphany, or at least allow it as an alternative to Iceweasel, but it doesn't for security reasons. The gnome-core description mentions the browser dependency:

These are the core components of the GNOME Desktop environment, an intuitive and attractive desktop.

This meta-package depends on a basic set of programs, including a file manager, an image viewer, a web browser, a video player and other tools.

It contains the official “core” modules of the GNOME desktop.

So the reasons it depends on Iceweasel are two-fold:

  • it's defined as depending on a web browser;
  • the only sensible browser to depend on for the GNOME desktop is Iceweasel, because Epiphany doesn't have enough security support, and Chromium doesn't integrate into the desktop properly.

There used to be an alternative dependency on gnome-www-browser, but that was removed in 2011 (without explanation as far as I can tell). It may be worth asking the maintainers to re-introduce it, but it wouldn't help you install gnome-core without a browser.

The mechanisms which lead to GNOME being removed if you remove Iceweasel are relatively straightfoward. When you ask apt-get to do something, it tries really hard to do it — so removing a package removes anything which depends on it (after asking you). gnome-core depends on iceweasel, and gnome depends on gnome-core, so

apt-get remove iceweasel

also removes gnome-core and gnome.

Removing these meta-packages causes all the packages they depend on to become candidates for removal using autoremove, since the packaging system now considers them to be unnecessary (no package marked as not automatically installed depends on them). The packaging system considers that the user really wants those packages which are marked as explicitly installed, and anything else is only installed to support those packages. So if anything removes gnome or gnome-core, the next time you run apt-get autoremove, it will consider that many of the installed packages are unnecessary...

There are a couple of workarounds:

  • if you want to keep gnome-core installed without Iceweasel, use equivs or apt-holepunch (the latter is much easier to use in this case, thanks Joshua!) to build a fake iceweasel package and install that along with gnome-core;

  • go through all the packages that gnome and gnome-core depend on, decide which of them you want to use and/or need (e.g. gdm3, gnome-session, nautilus...), and mark them using

      apt-mark manual ...
    

    or using aptitude's GUI (which will be a lot easier).

In any case you can't break your VM by removing packages unless you start removing essential packages (and apt-get will loudly complain before letting you do so), or the kernel. You might end up having to log in to a text console, but you can fix things from there just as well as from an X terminal emulator.

Related Question