02 July 2013

471. Debian Jessie -- gnome-shell bug

Update 3/7/2013:
there are now *gnome-bluetooth packages (3.8.1-2) in the jessie repos now. While I haven't looked closer at them, I presume that they fix this issue.

(on a different note: dist-upgrade currently removes gnome...)

Original post:
I've used debian testing since early 2011, and I've only had a few minor issues during that time.

However, sometimes things happen that reminds you that the Testing release is not meant for mission critical work (and makes me happy that I only use Jessie on my laptop, which I mainly use at home).


Last night I did upgrade and dist-upgrade, which installed the following packages according to /var/log/apt/history:
Start-Date: 2013-07-01  22:03:17
Commandline: apt-get dist-upgrade
Install: p11-kit:amd64 (0.18.3-2, automatic), libgnome-bluetooth11:amd64 (3.8.1-1, automatic), libgcr-base-3-1:amd64 (3.8.2-3, automatic), libtasn1-6:amd64 (3.3-1, automatic), libgcr-ui-3-1:amd64 (3.8.2-3, automatic)
Upgrade: libnm-gtk0:amd64 (,, libgcr-3-1:amd64 (3.4.1-3, 3.8.2-3), gir1.2-gcr-3:amd64 (3.4.1-3, 3.8.2-3), network-manager-gnome:amd64 (,, gnome-keyring:amd64 (3.4.1-5, 3.8.2-2), gcr:amd64 (3.4.1-3, 3.8.2-3), gnome-bluetooth:amd64 (3.4.2-1, 3.8.1-1), gir1.2-gnomebluetooth-1.0:amd64 (3.4.2-1, 3.8.1-1), gir1.2-gck-1:amd64 (3.4.1-3, 3.8.2-3)
End-Date: 2013-07-01  22:03:29

Now what happens when I log in to gnome via gdm3 I get an empty desktop with no menus, no hot-spots or anything else indicating that things worked out. Alt+F2 doesn't work either, and conky doesn't start.

The only thing that does work is
* my keyboard shortcuts (I've mapped ctrl+shift+Down arrow to chromium)
* guake (which starts with gnome)

ps aux|grep gnome-shell
returns nothing, which might be a clue.

Looking at the debian forums the closest post seems to be (although erroneously labelled -- gdm3 DOES start): http://forums.debian.net/viewtopic.php?f=6&t=105393&p=504077&hilit=gnome+shell#p504077

That in turn led to this bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=712861

My gnome-shell version is 3.4.2-8,

I don't understand how gnome-bluetooth causes this, especially given that I've disabled bluetooth in rcconf, but whatever it takes...

I tried applying the patch but it failed:
mkdir ~/tmp
cd ~/tmp
wget "http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=66;filename=GnomeBluetooth.patch;att=1;bug=712861" -O blue.patch
sed -i 's_js/ui/status/bluetooth.js_/usr/share/gnome-shell/js/ui/status/bluetooth.js_g' blue.patch
sudo patch -p0 < blue.patch

Instead, I ended up making the changes to /usr/share/gnome-shell/js/ui/status/bluetooth.js by hand (remember that you can always use the ttys using ctrl+Fx):
  6 const Gio = imports.gi.Gio;
  7 const GnomeBluetoothApplet = imports.gi.GnomeBluetoothApplet;
  8 const GnomeBluetooth = imports.gi.GnomeBluetooth;
  9 const Gtk = imports.gi.Gtk;

and then delete the Applet part in GnomeBluetoothApplet so that it reads
 38         this._killswitch.connect('toggled', Lang.bind(this, function() {
 39             let current_state = this._applet.killswitch_state;
 40             if (current_state != GnomeBluetooth.KillswitchState.HARD_BLOCKED &&
 41                 current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER) {
 42                 this._applet.killswitch_state = this._killswitch.state ?
 43                     GnomeBluetooth.KillswitchState.UNBLOCKED:
 44                     GnomeBluetooth.KillswitchState.SOFT_BLOCKED;
 45             } else
 46                 this._killswitch.setToggleState(false);

Then do it again:
 96     _updateKillswitch: function() {
 97         let current_state = this._applet.killswitch_state;
 98         let on = current_state == GnomeBluetooth.KillswitchState.UNBLOCKED;
 99         let has_adapter = current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER;
100         let can_toggle = current_state != GnomeBluetooth.KillswitchState.NO_ADAPTER &&
101                          current_state != GnomeBluetooth.KillswitchState.HARD_BLOCKED;

At this point I rebooted and everything was back to normal (you can try simply doing 'sudo service gdm3 restart' instead of rebooting).
Anyway, done.


  1. The Jessie gnome-shell wiped out the gnome desktop here too before the above post appeared. Not being aware of the above surgical approach I resorted to an attempt to upgrade gnome-shell and several other gnome packages to sid in an attempt to cure it. The program apt-listbugs listed two serious bugs in potential dependent packages but fortunately they did not involve gnome-shell.

    After being unable to resist also upgrading libreoffice, I had to remove libreoffice altogether afterwards in order to preserve dist-upgrade equilibrium. Ended up replacing it with unstable version 4.1 directly from the website but the word menus are a litttle shaky.

    The gnome artwork is prettier but root terminal attempts to launch nautilus give:

    ** (nautilus:6839): WARNING **: Could not open X display

    Otherwise seems to have survived the upgrade unscathed - with empasis on seems.

    Being capable of identifying the real source of the problem is more rational.

    1. If you want to roll back what you did and downgrading, you can find the unstable/sid packages using e.g.
      apt-show-versions |grep unstable

      Likewise, packages not from any of the standard release can be found using
      apt-show-versions|egrep -v "wheezy|jessie|unstable"

      Or you can continue to live interestingly :)

      Re nautilus, presuming that you are using gksu, what does
      printenv | grep DISPLAY
      when run as root?

  2. Interestingly ---

    # printenv | grep DISPLAY

    The issue with root terminal seem due to the upgrade introducing a defective launcher /usr/share/applications/Root Terminal - with the command

    gksu /usr/bin/x-terminal-emulator

    which gives the error ** (nautilus:6839): WARNING **: Could not open X display - and only launches once after login.

    A root terminal that can reliably launch gksu and root nautilus is creating a new launcher /usr/share/applications/Root xterm - with the command

    gksu xterm

    The upgraded packages seem to be handling dist-upgrades well so apparently no need to downgrade but if not the question would be how:

    The file /etc/debian_version contains jessie/sid and the regular debian repositories are pointed at jessie apart from

    deb ftp://ftp.deb-multimedia.org sid main non-free

    Therefore apt-show-versions |grep sid gives a moderately long list of multimedia programs and their depencies.

    (apt-show-versions |grep unstable only shows google-chrome)

    If they had not been behaving themselves would there be a straightforward way of downgrading all unstable packages or with certain exceptions and fixing them at testing -currently jessie?

    1. You can force a release by using a preferences file for apt (apt pinning).

      By default, if there are several versions of a package available (e.g. b/c of both testing and unstable being in sources.list) the highest version number will always be prioritised.

      On a side note: the debian devs are unhappy with deb-multimedia for the same reason -- because of how the packages are labelled they will always take precedence, regardless of version.

      However, you can change the priority settings so that your system will tolerate higher versions, but won't install them unless told so explicitly.

      And you can also use a priority setting which forces the version from a particular release, regardless of whether it will cause a downgrade (pref > 1000).

      Most of this you probably already know. You can read more doing 'man apt_preferences' and http://verahill.blogspot.com.au/2011/12/apt-pinning-in-debian-simple-example.html

      Long story short, to downgrade everything WITHOUT EXCEPTION create /etc/apt/preferences and put this in it:
      Package: *
      Pin: release a=testing
      Pin-Priority: 1100

      Package: *
      Pin: release a=unstable
      Pin-Priority: -10

      I think an upgrade/dist-upgrade will sort things out. You will also want to change the deb-multimedia sources line from sid to jessie.

      I think you can make exceptions by putting holds on the packages (http://verahill.blogspot.com.au/2012/07/freezing-gnome.html) , but then they will not be tracking the repo, so it's not a good solution.