Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm attempting to upgrade my work machine from 12.04 to 14.04, but having issues.

sudo update-manager -d:

** (update-manager:20416): WARNING **: Command line `dbus-launch --autolaunch=f01c8e2b23ace751460ef7f800000009 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n
Traceback (most recent call last):
  File "/usr/bin/update-manager", line 26, 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

I've tried stuff like removing .Xauthority

Launching it without sudo works, but it fails when I click upgrade:

authenticate 'trusty.tar.gz' against 'trusty.tar.gz.gpg' 
extracting 'trusty.tar.gz'
can't load DistUpgradeViewGtk3 (Gtk couldn't be initialized)

Any ideas on how I can launch sudo update-manager -d ?

share|improve this question
    
Is this from a graphical terminal or are you doing this via a TTY or over SSH? –  Oli Aug 18 at 12:31

1 Answer 1

Try:

sudo DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY update-manager -d
share|improve this answer
    
sudo shouldn’t munch the variables (so they shouldn’t need persisting manually, see: sudo bash -c 'echo $DISPLAY') and you shouldn't run graphical things with plain-old sudo (for the very reason that they can ruin your .Xauthority, etc). –  Oli Aug 18 at 12:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.