sudo not working in ubuntu

Bug #1330154 reported by Arghya Basak
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
pam-xdg-support (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

when I try sudo gedit the command does not work.
following is a sample output in terminal

arghya@arg-u2:~$ sudo gedit /etc/hosts
[sudo] password for arghya:
error: XDG_RUNTIME_DIR not set in the environment.

(gedit:11805): Gtk-WARNING **: cannot open display:
arghya@arg-u2:~$

pardon me for being a linux newbie.

Revision history for this message
Filip Sohajek (filip-sohajek-deactivatedaccount) wrote :

It's not a bug. SuperUser has no XDG_RUNTIME_DIR variable set. To fix it, replace sudo gedit call with
pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gedit

Changed in pam-xdg-support (Ubuntu):
status: New → Invalid
Revision history for this message
Arghya Basak (sendarghyamail) wrote : Re: [Bug 1330154] Re: sudo not working in ubuntu

Working fine! But I wonder how in some machines(with the same ubuntu 14.04
LTS) just the 'sudo gedit ' command works ok.
Anyway, thanks a lot. :)

ARGHYA BASAK
Roll No. - ME13M006
M.Tech, Mechanical Engineering Department
IIT Madras

On Tue, Jun 17, 2014 at 6:49 PM, Filip Sohajek <email address hidden>
wrote:

> It's not a bug. SuperUser has no XDG_RUNTIME_DIR variable set. To fix it,
> replace sudo gedit call with
> pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gedit
>
>
> ** Changed in: pam-xdg-support (Ubuntu)
> Status: New => Invalid
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1330154
>
> Title:
> sudo not working in ubuntu
>
> Status in “pam-xdg-support” package in Ubuntu:
> Invalid
>
> Bug description:
> when I try sudo gedit the command does not work.
> following is a sample output in terminal
>
> arghya@arg-u2:~$ sudo gedit /etc/hosts
> [sudo] password for arghya:
> error: XDG_RUNTIME_DIR not set in the environment.
>
> (gedit:11805): Gtk-WARNING **: cannot open display:
> arghya@arg-u2:~$
>
> pardon me for being a linux newbie.
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/pam-xdg-support/+bug/1330154/+subscriptions
>

Revision history for this message
Xavier (xavier-depedro) wrote :

Hi there.

I wouldn't call it "invalid" bug report (considering the end-user perspective). As far as I remember, this hack (pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY gedit) was not needed in previous versions of Ubuntu, so it looks like a "regression" bug to me.

Anyways, is there any way to get this partial solution stored more permanently in the computer? (adding something to some .bashrc or something; sorry, I'm not that expert in handling default values of environment variables, so some tips would help end users).

Thanks in advanced for your support, of course.

Revision history for this message
sokolov (daniel-sokolov) wrote :

Filip's proposed solution does not work for me.

Revision history for this message
sokolov (daniel-sokolov) wrote :

PS: The problem only occurs if I start a program from a Root terminal. If I start it with sudo from a normal terminal, I do not run in the bug at all. There are some error messages in the terminal, but everything works fine.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.