19

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.
7
  • See askubuntu.com/questions/5636/… for commands to help you in that. – phk Oct 30 '16 at 8:00
  • Thanks PHK. Apt tells me the dependencies. I'm interesting in knowing why the dependencies exist. I doubt aptitude will tell me why a dependency exists. – user56041 Oct 30 '16 at 8:10
  • 1
    Oh OK, but if e.g. it was a direct dependency of let's say debian-desktop (I know this is Debian and not Ubuntu but just for the sake of argument) amongst other browsers then it would tell you that someone thought that a web browser is essential for a graphical desktop. – phk Oct 30 '16 at 8:17
  • (and the trick in that case, is you have to go down one layer, select the dependencies of task-gnome-desktop that you actually want, and apt-mark those as manually installed before you remove task-gnome-desktop). If you've been using debian for a while, it's possible this is surprising because debian didn't originally use these single metapackages to implement their "tasks". – sourcejedi Oct 30 '16 at 9:15
  • 1
    Maybe it's because the * ? I destroyed my gnome with apt-get remove wine* before. – Rio6 Oct 31 '16 at 2:03
23

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.

8
  • Great answer! Just wondering, what is the gnome-www-browser "virtual" package then about? – phk Oct 30 '16 at 11:02
  • 2
    @phk That's an excellent question, the alternative dependency on gnome-www-browser was removed in 2011 but it is still provided by Chromium, Epiphany, Iceweasel and Firefox... (And Cinnamon still uses it.) – Stephen Kitt Oct 30 '16 at 11:48
  • 1
    Incidentally, here is something that does the job of excluding a package from dependency w/o the build-env depends of equivs: mail-archive.com/debian-bugs-dist@lists.debian.org/msg900702/… – Joshua Oct 31 '16 at 3:45
  • Thanks Stephen. I don't mean to split hairs, bit why is it a dependency? Regarding "it's defined as depending on a web browser", I can't get my head around why the dependency exists. That's really my question. Sorry for the confusion. – user56041 Nov 1 '16 at 3:00
  • Also, you are right about "... you can't break your VM by removing [these particular] packages". After a reboot, I got a non-GUI logon screen, and I was able to SSH into the box. I'm happy with the Terminal/Command Line, so its clearly not broken or useless for me. Others may need a Desktop, however. I would not want my mother or father trying to use the machine. – user56041 Nov 1 '16 at 3:05
2

Tasks are selected at install time (tasksel), and there is not a separate task for "web browser"... In theory it could be desktop-specific, as in KDE3 days. People expect the default desktop to include a web browser, if nothing else to get help on their new system :). Therefore the desktop task includes a default web browser, QED.

Except our question comments are wrong. task-gnome-desktop does not require iceweasel. It only recommends it.

(The most upvoted answer indicates there's an indirect relationship which does require it. On the face of it, there may well be room for improvement in this dependency structure. I think the following is still valid however.)

You missed something very important.

The following packages were automatically installed and are no longer required: hyphen-en-us libfs6 task-desktop

It turns out (after removing iceweasel?) you had no packages installed which either depended on or recommended task-desktop. Nor was it marked as manually installed. So of course apt-get autoremove removes it.

Question mark because looking at the Debian package database, I don't see how iceweasel depends on or recommends task-desktop. It might already have been auto-removable.

Take care when using auto-remove. If auto-remove says your entire desktop is considered unnecessary, then cancel it and mark your desktop as manually installed (apt-mark).

VM is not useless; you can log in to the console and run apt-get install task-gnome-desktop. If you don't want a recommended package like iceweasel, you can try to use apt-get install task-gnome-desktop iceweasel-.

It's also possible to unmark recommended dependencies by using synaptic (GUI) or aptitude (TUI). (Note that aptitude does auto-remove by default, whereas synaptic has a list of no-longer-needed packages you can find somewhere). Sadly, IME synaptic can be quite clunky and laggy nowadays if you try to do this sort of stuff. See https://askubuntu.com/questions/622031/how-do-i-exclude-specific-packages-from-installation-with-apt-get

2

You really shouldn't use * regexes to remove things-- and I know that from experience. Using * deletes every package with a name containing "iceweasel". If you want to delete iceweasel remove the iceweasel package (no asterisk) and delete the contents of the iceweasel folder. I have no idea what the offending "iceweasel" package is, it could be any reverse dependency of hyphen-en-us libfs6 task-desktop x11-apps x11-session-utils x11-xfs-utils xinit xorg. Any of those. A quick look and autoremoving xorg/x11 alone would break 99% of *Nix GUIs. To find out what iceweasel packages you deleted do grep iceweasel /var/log/apt/history.log and look for lines beginning with "Remove:" under the Commandline: apt-get remove iceweasel* If you're still curious post the results and I (or someone else) can figure out the exact dependency issues. :)

A dependency issue like this is illogical of course and its existence is a mistake on the part of the people who made the metadata for your .deb's. I would figure out the exact problem before filing a bug report though. Hence my answer above. :D

12
  • Thanks trudgemank. I'm more interested in why the dependency exists; not what the dependency is. – user56041 Oct 30 '16 at 10:11
  • It shouldn't exist. Its existence is a mistake on the part of the people who made the metadata for your .deb's, which aren't perfect. There are consequences they don't foresee. – trudgemank Oct 30 '16 at 10:19
  • You must have deleted an "iceweasel" package that's isn't part of the iceweasel metapackage. Possibly one installed by default. – trudgemank Oct 30 '16 at 10:27
  • Trudgemank - If you answer the question I asked in your answer rather than the comments, then I would be happy to accept the answer. For completeness, here's the answer which I believe to be correct: "... [it] is a mistake on the part of the people who made the metadata for your .deb's". Sorry to split hairs; that really was the item of interest for me. With the info in hand, I can go file a bug report. – user56041 Oct 30 '16 at 22:41
  • It's alright, as long as I helped I don't need official affirmation. But you don't don't the particular dependency issue, you really should if you want to file a bug report. – trudgemank Oct 31 '16 at 1:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy