1

I was just browsing around when I came by this answer. It suggests removing xdiagnose if your laptop is overheating. I immediately fired up the dash and clicked on the xdiagnose icon, nothing happened. I searched around and saw this question. The answer was to run it as root user. I did that only to face this error:

subroot@subroot:~$ sudo xdiagnose
[sudo] password for subroot: 
Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 key
** (xdiagnose:5280): WARNING **: Command line `dbus-launch --autolaunch=7f8731869e1c690b8205727e0000000a --binary-syntax --close-stderr' exited with non-zero exit status 1: Invalid MIT-MAGIC-COOKIE-1 keyInvalid MIT-MAGIC-COOKIE-1 keyAutolaunch error: X11 initialization failed.\n
Traceback (most recent call last):
  File "/usr/bin/xdiagnose", line 37, in <module>
    from xdiagnose.applet import XDiagnoseApplet
  File "/usr/lib/python2.7/dist-packages/xdiagnose/applet.py", line 6, in <module>
    from gi.repository import Gtk
  File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 76, in load_module
    dynamic_module._load()
  File "/usr/lib/python2.7/dist-packages/gi/module.py", line 224, in _load
    overrides_modules = __import__('gi.overrides', fromlist=[self._namespace])
  File "/usr/lib/python2.7/dist-packages/gi/overrides/Gtk.py", line 1533, in <module>
    raise RuntimeError("Gtk couldn't be initialized")
RuntimeError: Gtk couldn't be initialized
subroot@subroot:~$

gksu xdiagnose doesn't help either, it displays no errors but it doesn't do anything either.

Then I tried removing it apt-get remove, only to be told that the ubuntu-desktop package will be removed also. Of course I didn't.

This brings me to my question, what is xdiagnose and what is its purpose?

Parto
  • 15,325
  • 24
  • 86
  • 117

1 Answers1

1
  • xdiagnose - Analysis tools for troubleshooting X.org problems. See its help:

    sudo  xdiagnose -h
    
  • Try reinstalling, by purging without removing dependents:

    sudo dpkg --purge --force-all xdiagnose
    sudo apt-get install xdiagnose
    
  • Edit /etc/sudoers (as root), add this line:

    Defaults env_keep="XAUTHORIZATION XAUTHORITY TZ PS2 PS1 PATH LS_COLORS KRB5CCNAME HOSTNAME HOME DISPLAY COLORS"`
    

    Ref: Can't open Gedit as root

enter image description here

user.dz
  • 48,105
  • Still getting same error. – Parto Feb 12 '14 at 09:14
  • Try export DISPLAY=:0.0 ; sudo xdiagnose, if no success see with rm ~/.Xauthority* then save your work on other windows and restart lightdm sudo restart lightdm, try again sudo xdiagnose. – user.dz Feb 12 '14 at 10:53
  • Did some answer and found an answer. http://askubuntu.com/a/414810/163331 – Parto Feb 12 '14 at 17:26
  • @AvatarParto, Such similar bugs will have different titles and error messages, It's new to me. Now, I should be able to figure out as sudo problem. I have updated answer. Thank you very much. – user.dz Feb 12 '14 at 18:01
  • @AvatarParto, It's weird, that my etc/sudoers has no env_keep line but every thing works well. I think there is other place (config file) that cover similar option. – user.dz Feb 12 '14 at 18:17
  • 1
    How about if you run sudo sudo -V? For me, I think it's something I did with either dconf editor or Gconf...not sure though. – Parto Feb 12 '14 at 18:20