1

i have a fresh ubuntu 12.04 installation with encrypted home partition.

i copied over my home folder from another computer.

when i try to launch graphical programs via sudo i get errors like the following.

nailor@macbuntu:~$ sudo synaptic
No protocol specified
No protocol specified

(synaptic:18080): Gtk-WARNING **: cannot open display: :0

or

nailor@macbuntu:~$ sudo gedit
No protocol specified

** (gedit:18085): WARNING **: Command line `dbus-launch --autolaunch=3122eb74fe95c3593833223f0000000c --binary-syntax --close-stderr' exited with non-zero exit status 1: No protocol specified\nNo protocol specified\nAutolaunch error: X11 initialization failed.\n
No protocol specified
Cannot open display: 
Run 'gedit --help' to see a full list of available command line options.

or

nailor@macbuntu:~$ sudo xterm
No protocol specified
No protocol specified
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm Xt error: Can't open display: %s
nailor@macbuntu:~$ 

what can i do to correct the situation?

ps: situation with gksudo

nailor@macbuntu:~$ gksudo xterm
Error copying '/home/nailor/.Xauthority' to '/tmp/libgksu-yRgesp': No such file or directorynailor@macbuntu:~$
mnagel
  • 995
  • 1
  • 8
  • 21

1 Answers1

0

You don't need to use sudo or gksudo to open Synaptic. Just search for Synaptic in the Dash, and click on the Synaptic icon. You will be asked to authenticate with your user password in order to open Synaptic.

You don't need to use sudo or gksudo to open Gedit. It is a bad idea anyway as it can cause data corruption. Instead use sudo nano from the terminal. Nano is terminal program, so it runs from the terminal instead of from a graphical user interface. You can also use vi instead of nano, but nano is easier to use.

You don't need to open XTerm as root. Instead open XTerm and use the sudo command in XTerm the same way you would in the default Ubuntu Terminal application.

karel
  • 114,770
  • 2
    i know that there are alternatives for all the examples listed. this does not change the fact that i should be able to run arbitrary x programs as root. – mnagel Aug 06 '13 at 18:50
  • 1
    if i start synaptic from the dash, it asks for a password and then nothing happens. password dialog disappears and nothing else happens. – mnagel Aug 06 '13 at 18:51
  • Then edit your question. That's not supposed to happen with Synaptic. In my opinion that is your real problem. Also you should try to avoid running graphical user interface applications as root. – karel Aug 06 '13 at 18:52