title: Debian: dist-upgrade removes gnome and many other stuff
body: <p>I am (was) running the Debian Sid and faced a major update problem few days ago. It was weekend and I was just going to upgrade stuff, did <code>sudo apt-get update</code>, then <code>sudo apt-get upgrade</code>. Then I saw that some packages are kept back and blah-blah-blah so I did <code>sudo apt-get dist-upgrade</code> and <code>sudo apt-get autoremove</code> with a large number of packages to be affected by both commands (this frightened me already, but it was too late). After reboot I appeared not to have any gnome, xorg, network connection. I've backed up the critical data and went with reinstall. After installing stable Debian I've changed sources.list to have Sid in there and went with same update -> upgrade -> dist-upgrade to make Sid of it. But it all ended up with the same trouble. So, currently, I did fresh install again, changed sources.list, did upgrade and now it offers me dist-upgrade, here are the outputs:</p>
  
  <pre><code>$ sudo apt-get upgrade 
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  Calculating upgrade... The following packages were automatically installed and are no longer required:
    docutils-common docutils-doc libegl1-mesa-drivers libelfg0 libopenvg1-mesa perlmagick python-docutils python-pygments
    python-roman
  Use 'apt-get autoremove' to remove them.
  Done
  The following packages have been kept back:
    bijiben cpp cpp-4.9 dh-python dnsmasq-base evolution evolution-common evolution-data-server evolution-data-server-common
    evolution-plugins folks-common gcc-4.9-base ghostscript gir1.2-clutter-1.0 gir1.2-gdata-0.0 gir1.2-git2-glib-1.0 gir1.2-goa-1.0
    gir1.2-gtop-2.0 gir1.2-mutter-3.0 gir1.2-networkmanager-1.0 gir1.2-nmgtk-1.0 gir1.2-rb-3.0 gir1.2-totem-1.0 gir1.2-tracker-1.0
    gnome-contacts gnome-control-center gnome-control-center-data gnome-dictionary gnome-documents gnome-keyring gnome-maps
    gnome-music gnome-nettool gnome-online-accounts gnome-online-miners gnome-photos gnome-settings-daemon gnome-shell
    gnome-shell-common gnome-shell-extensions gnome-sushi gnome-system-monitor gnome-themes-standard gnome-themes-standard-data
    goobox grilo-plugins-0.2 gstreamer0.10-plugins-bad gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-plugins-good
    gstreamer1.0-plugins-ugly gvfs gvfs-backends gvfs-bin gvfs-common gvfs-daemons gvfs-fuse gvfs-libs iceweasel initscripts
    libaacs0 libarchive13 libasound2-plugins libavcodec56 libchromaprint0 libcloog-isl4 libclutter-1.0-0 libclutter-gtk-1.0-0
    libcurl3-gnutls libevolution libfile-basedir-perl libfolks-eds25 libfolks-telepathy25 libfolks25 libgcc1 libgd3 libgegl-0.2-0
    libgfortran3 libgit2-glib-1.0-0 libgnutls-deb0-28 libgnutls-openssl27 libgoa-1.0-0b libgoa-1.0-common libgoa-backend-1.0-1
    libgomp1 libgphoto2-6 libgpod-common libgpod4 libgs9 libgs9-common libgstreamer-plugins-bad0.10-0 libgstreamer-plugins-bad1.0-0
    libimobiledevice4 libldap-2.4-2 libnm-gtk-common libnm-gtk0 libnss-myhostname libobjc4 libopencv-calib3d2.4 libopencv-contrib2.4
    libopencv-core2.4 libopencv-features2d2.4 libopencv-flann2.4 libopencv-highgui2.4 libopencv-imgproc2.4 libopencv-legacy2.4
    libopencv-ml2.4 libopencv-objdetect2.4 libopencv-video2.4 libpam-systemd libpod-readme-perl libquadmath0 libreoffice
    libreoffice-base libreoffice-base-core libreoffice-base-drivers libreoffice-calc libreoffice-common libreoffice-core
    libreoffice-draw libreoffice-evolution libreoffice-gnome libreoffice-gtk libreoffice-help-en-us libreoffice-impress
    libreoffice-math libreoffice-style-galaxy libreoffice-style-tango libreoffice-writer librtmp1 libsane libsane-common
    libspice-client-glib-2.0-8 libspice-client-gtk-3.0-4 libstdc++6 libsystemd0 libtotem-plparser18 libtotem0
    libtracker-control-1.0-0 libtracker-miner-1.0-0 libtracker-sparql-1.0-0 libudev1 libusbmuxd2 linux-image-amd64 metacity
    metacity-common mutter mutter-common network-manager network-manager-gnome procps python-lxml python-pycurl python3-uno
    rhythmbox rhythmbox-data rhythmbox-plugin-cdrecorder rhythmbox-plugins rsyslog rygel rygel-playbin rygel-tracker systemd
    sysvinit-utils texinfo totem totem-common totem-plugins tracker tracker-extract tracker-gui tracker-miner-fs transmission-common
    transmission-gtk udev upower usb-modeswitch usb-modeswitch-data usbmuxd util-linux util-linux-locales wget xserver-xephyr
    xserver-xorg-core xserver-xorg-input-wacom xserver-xorg-video-ati xserver-xorg-video-cirrus xserver-xorg-video-fbdev
    xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-mga xserver-xorg-video-neomagic xserver-xorg-video-nouveau
    xserver-xorg-video-openchrome xserver-xorg-video-qxl xserver-xorg-video-r128 xserver-xorg-video-radeon xserver-xorg-video-savage
    xserver-xorg-video-siliconmotion xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-trident
    xserver-xorg-video-vesa xserver-xorg-video-vmware zenity zenity-common
  0 upgraded, 0 newly installed, 0 to remove and 206 not upgraded.
  </code></pre>
  
  <p>and:</p>
  
  <pre><code>$ sudo apt-get dist-upgrade 
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  Calculating upgrade... The following packages were automatically installed and are no longer required:
    cpp-4.9 docutils-common docutils-doc evolution-common gir1.2-gweather-3.0 gir1.2-mediaart-1.0 gnome-media
    gstreamer0.10-pulseaudio libavformat56 libcloog-isl4 libcoverart0 libcryptui0a libdirac-encoder0 libebackend-1.2-10
    libedata-cal-1.2-27 libedataserverui-1.2-1 libegl1-mesa-drivers libelfg0 libgdict-1.0-6 libgit2-21 libgphoto2-port10 libgtop2-7
    libisl10 libjim0.75 libmediaart-1.0-0 libmusicbrainz5-1 libopenvg1-mesa liborcus-0.10-0 libpagemaker-0.0-0 libplist2
    libregexp-common-perl librhythmbox-core8 librygel-core-2.4-2 librygel-renderer-2.4-2 librygel-renderer-gst-2.4-2
    librygel-server-2.4-2 libswscale3 libvpx1 libwps-0.4-4 libx264-142 perlmagick python-docutils python-pygments python-roman
    seahorse-daemon
  Use 'apt-get autoremove' to remove them.
  Done
  The following packages will be REMOVED:
    evolution evolution-data-server evolution-plugins gdm3 gnome gnome-contacts gnome-core gnome-session gnome-shell
    gnome-shell-extension-weather gnome-shell-extensions libboost-date-time1.55.0 libcmis-0.4-4 libebook-1.2-14
    libebook-contacts-1.2-0 libedata-book-1.2-20 libevolution libfolks-eds25 libhogweed2 libmetacity-private2 libmutter0e libnettle4
    libphonenumber6 libreoffice libreoffice-avmedia-backend-gstreamer libreoffice-base libreoffice-base-core
    libreoffice-base-drivers libreoffice-calc libreoffice-core libreoffice-draw libreoffice-evolution libreoffice-gnome
    libreoffice-gtk libreoffice-help-en-us libreoffice-impress libreoffice-math libreoffice-report-builder-bin
    libreoffice-sdbc-firebird libreoffice-sdbc-hsqldb libreoffice-writer mythes-en-us powertop printer-driver-brlaser python3-uno
    task-gnome-desktop tracker-utils unoconv xserver-xorg-video-modesetting
  The following NEW packages will be installed:
    binutils cpp-5 firmware-linux-free gcc gcc-5 gcc-5-base gir1.2-gfbgraph-0.2 gir1.2-gweather-3.0 gir1.2-javascriptcoregtk-4.0
    gir1.2-mediaart-2.0 gir1.2-webkit2-4.0 gstreamer1.0-clutter-3.0 irqbalance libapparmor1 libappindicator3-1 libasan2 libatomic1
    libavcodec-ffmpeg56 libavformat-ffmpeg56 libavresample-ffmpeg2 libavutil-ffmpeg54 libb-hooks-endofscope-perl
    libb-hooks-op-check-perl libbareword-filehandles-perl libbdplus0 libc-dev-bin libc6-dev libcamel-1.2-52 libcc1-0 libcilkrts5
    libclass-method-modifiers-perl libclass-xsaccessor-perl libclutter-gst-3.0-0 libcoverart1 libcoverartcc1 libcpan-changes-perl
    libcryptui0a libcrystalhd3 libdata-perl-perl libdbusmenu-glib4 libdbusmenu-gtk3-4 libdevel-caller-perl
    libdevel-globaldestruction-perl libdevel-lexalias-perl libdpkg-perl libebackend-1.2-10 libecal-1.2-18 libedata-cal-1.2-27
    libedataserver-1.2-20 libedataserverui-1.2-1 libexporter-tiny-perl libfdisk1 libfile-fcntllock-perl libfile-slurp-perl
    libgcc-5-dev libgdata22 libgdict-1.0-8 libgetopt-long-descriptive-perl libgit2-22 libgom-1.0-0 libgom-1.0-common
    libgphoto2-port12 libgtop-2.0-10 libhogweed4 libhttp-parser2.1 libimport-into-perl libindicator3-7 libindirect-perl libinput10
    libio-stringy-perl libipc-system-simple-perl libisl13 libitm1 libjavascriptcoregtk-4.0-18 libjim0.76
    liblexical-sealrequirehints-perl liblist-moreutils-perl liblognorm2 liblsan0 liblz4-1 libmediaart-2.0-0 libmetacity-private3
    libmodule-implementation-perl libmodule-runtime-perl libmoo-perl libmoox-handlesvia-perl libmpx0 libmultidimensional-perl
    libmusicbrainz5-2 libmusicbrainz5cc2 libmutter0f libnamespace-autoclean-perl libnamespace-clean-perl libnettle6 libnm0 libnuma1
    liborcus-0.10-0 libpackage-stash-perl libpackage-stash-xs-perl libpadwalker-perl libpagemaker-0.0-0 libparams-classify-perl
    libparams-validate-perl libpath-tiny-perl libplist3 libpod-markdown-perl libprocps4 librhythmbox-core9 librole-tiny-perl
    librygel-core-2.6-2 librygel-renderer-2.6-2 librygel-renderer-gst-2.6-2 librygel-server-2.6-2 libseccomp2 libshine3 libsoxr0
    libssh-gcrypt-4 libstemmer0d libstrictures-perl libsub-exporter-progressive-perl libsub-identify-perl libswresample-ffmpeg1
    libswscale-ffmpeg3 libtotem-plparser-common libtrio2 libtry-tiny-perl libtsan0 libtype-tiny-perl libtype-tiny-xs-perl libubsan0
    libunicode-utf8-perl libvariable-magic-perl libvpx2 libwebkit2gtk-4.0-37 libwps-0.4-4 libx264-146 libx265-59 libxcb-render-util0
    linux-image-4.0.0-2-amd64 linux-libc-dev manpages-dev pinentry-gnome3 python-bs4 python-html5lib seahorse-daemon tex-common
  The following packages will be upgraded:
    bijiben cpp cpp-4.9 dh-python dnsmasq-base evolution-common evolution-data-server-common folks-common gcc-4.9-base ghostscript
    gir1.2-clutter-1.0 gir1.2-gdata-0.0 gir1.2-git2-glib-1.0 gir1.2-goa-1.0 gir1.2-gtop-2.0 gir1.2-mutter-3.0
    gir1.2-networkmanager-1.0 gir1.2-nmgtk-1.0 gir1.2-rb-3.0 gir1.2-totem-1.0 gir1.2-tracker-1.0 gnome-control-center
    gnome-control-center-data gnome-dictionary gnome-documents gnome-keyring gnome-maps gnome-music gnome-nettool
    gnome-online-accounts gnome-online-miners gnome-photos gnome-settings-daemon gnome-shell-common gnome-sushi gnome-system-monitor
    gnome-themes-standard gnome-themes-standard-data goobox grilo-plugins-0.2 gstreamer0.10-plugins-bad gstreamer1.0-libav
    gstreamer1.0-plugins-bad gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gvfs gvfs-backends gvfs-bin gvfs-common
    gvfs-daemons gvfs-fuse gvfs-libs iceweasel initscripts libaacs0 libarchive13 libasound2-plugins libavcodec56 libchromaprint0
    libcloog-isl4 libclutter-1.0-0 libclutter-gtk-1.0-0 libcurl3-gnutls libfile-basedir-perl libfolks-telepathy25 libfolks25 libgcc1
    libgd3 libgegl-0.2-0 libgfortran3 libgit2-glib-1.0-0 libgnutls-deb0-28 libgnutls-openssl27 libgoa-1.0-0b libgoa-1.0-common
    libgoa-backend-1.0-1 libgomp1 libgphoto2-6 libgpod-common libgpod4 libgs9 libgs9-common libgstreamer-plugins-bad0.10-0
    libgstreamer-plugins-bad1.0-0 libimobiledevice4 libldap-2.4-2 libnm-gtk-common libnm-gtk0 libnss-myhostname libobjc4
    libopencv-calib3d2.4 libopencv-contrib2.4 libopencv-core2.4 libopencv-features2d2.4 libopencv-flann2.4 libopencv-highgui2.4
    libopencv-imgproc2.4 libopencv-legacy2.4 libopencv-ml2.4 libopencv-objdetect2.4 libopencv-video2.4 libpam-systemd
    libpod-readme-perl libquadmath0 libreoffice-common libreoffice-style-galaxy libreoffice-style-tango librtmp1 libsane
    libsane-common libspice-client-glib-2.0-8 libspice-client-gtk-3.0-4 libstdc++6 libsystemd0 libtotem-plparser18 libtotem0
    libtracker-control-1.0-0 libtracker-miner-1.0-0 libtracker-sparql-1.0-0 libudev1 libusbmuxd2 linux-image-amd64 metacity
    metacity-common mutter mutter-common network-manager network-manager-gnome procps python-lxml python-pycurl rhythmbox
    rhythmbox-data rhythmbox-plugin-cdrecorder rhythmbox-plugins rsyslog rygel rygel-playbin rygel-tracker systemd sysvinit-utils
    texinfo totem totem-common totem-plugins tracker tracker-extract tracker-gui tracker-miner-fs transmission-common
    transmission-gtk udev upower usb-modeswitch usb-modeswitch-data usbmuxd util-linux util-linux-locales wget xserver-xephyr
    xserver-xorg-core xserver-xorg-input-wacom xserver-xorg-video-ati xserver-xorg-video-cirrus xserver-xorg-video-fbdev
    xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-mga xserver-xorg-video-neomagic xserver-xorg-video-nouveau
    xserver-xorg-video-openchrome xserver-xorg-video-qxl xserver-xorg-video-r128 xserver-xorg-video-radeon xserver-xorg-video-savage
    xserver-xorg-video-siliconmotion xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-trident
    xserver-xorg-video-vesa xserver-xorg-video-vmware zenity zenity-common
  183 upgraded, 146 newly installed, 49 to remove and 0 not upgraded.
  Need to get 316 MB of archives.
  After this operation, 338 MB of additional disk space will be used.
  </code></pre>
  
  <p>As you see, gnome is being purged on dist-upgrade. I did search solutions over the web but did not find anything adequate. Marking gnome as manually installed package does not help.</p>
  
  <p>I also found some instructions to perform safe-upgrade with aptitude, but I've decided to try it after posting this question.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>After <code>sudo aptitude safe-upgrade</code> problem is still there, but the output is much smaller:</p>
  
  <pre><code>$ sudo apt-get dist-upgrade 
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  Calculating upgrade... Done
  The following packages will be REMOVED:
    evolution evolution-data-server evolution-plugins gdm3 gnome gnome-contacts gnome-core gnome-session gnome-shell
    gnome-shell-extension-weather gnome-shell-extensions libboost-date-time1.55.0 libcmis-0.5-5 libebook-1.2-16
    libebook-contacts-1.2-1 libedata-book-1.2-25 libevolution libfolks-eds25 libhogweed2 libnettle4 libphonenumber6 libreoffice
    libreoffice-avmedia-backend-gstreamer libreoffice-base libreoffice-base-core libreoffice-base-drivers libreoffice-calc
    libreoffice-core libreoffice-draw libreoffice-evolution libreoffice-gnome libreoffice-gtk libreoffice-help-en-us
    libreoffice-impress libreoffice-math libreoffice-report-builder-bin libreoffice-sdbc-firebird libreoffice-sdbc-hsqldb
    libreoffice-writer mythes-en-us powertop printer-driver-brlaser python3-uno task-gnome-desktop unoconv
    xserver-xorg-video-modesetting
  The following packages will be upgraded:
    gcc-4.9-base libcurl3-gnutls libgnutls-deb0-28 libgnutls-openssl27 libicu52 libldap-2.4-2 libstdc++6 python-pycurl wget
    xserver-xorg-core xserver-xorg-input-wacom xserver-xorg-video-ati xserver-xorg-video-cirrus xserver-xorg-video-fbdev
    xserver-xorg-video-intel xserver-xorg-video-mach64 xserver-xorg-video-mga xserver-xorg-video-neomagic xserver-xorg-video-nouveau
    xserver-xorg-video-openchrome xserver-xorg-video-qxl xserver-xorg-video-r128 xserver-xorg-video-radeon xserver-xorg-video-savage
    xserver-xorg-video-siliconmotion xserver-xorg-video-sisusb xserver-xorg-video-tdfx xserver-xorg-video-trident
    xserver-xorg-video-vesa xserver-xorg-video-vmware
  30 upgraded, 0 newly installed, 46 to remove and 0 not upgraded.
  Need to get 16.7 MB of archives.
  After this operation, 325 MB disk space will be freed.
  </code></pre>