X Server and Display Problem With sudo
Some time it happens that when you run any graphical window with sudo command like
$sudo gedit /etc/apt/apt.confyou may get error message like:
** (gedit:8392): WARNING **: Command line `dbus-launch --autolaunch=720d86dbc34b24ba21ce446600000009 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\nor any error message involving launching x-server.
Cannot open display:
Run 'gedit --help' to see a full list of available command line options.
To get rid of this kind of error message first open terminal and then run the following command
$sudo visudoThen add the following line at the end of the file.
Defaults env_keep="DISPLAY XAUTHORITY"Now if you are adding more than one variable in this form then use "+=" instead "=" (without quote).
Hope this will solve the problem.
Cheeres
APaul
Comments
Post a Comment
Please dont forget to tell me if this post helped you or not...