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 not sure what happened. A few days ago I installed some updates and now i get an error whenever I try to run sudo nautilus. If I run gksudo nautilus it hangs for a few seconds then does nothing.

enter image description here

Anyone else had the same issue, or know how to fix it? A similar thing happens when trying to run sudo gedit as well...

attempts to sudo other apps: enter image description here

Sudoers as requested: enter image description here

$DISPLAY and sudo sudo -V as requested: enter image description here enter image description here

share|improve this question
    
Can you use sudo for other GUI programs? Command-line programs? –  Kevin May 11 '12 at 1:33
    
added attempts to sudo something else.. –  jacobian May 11 '12 at 2:50
    
Share your /etc/sudoers please –  warl0ck May 11 '12 at 3:05
1  
It looks like $DISPLAY is being unset by sudo, or not set properly to begin with. Try echo $DISPLAY and post what that prints, and sudo sudo -V (yes, two sudos) and see which section DISPLAY is under (check/remove/preserve). –  Kevin May 11 '12 at 13:41
1  
Added results of $DISPLAY and sudo sudo -V as requested. –  jacobian May 13 '12 at 21:05

1 Answer 1

OK, unchanged output of sudo sudo -V shows this:

Environment variables to preserve:
    XAUTHORIZATION
    XAUTHORITY
    TZ
    PS2
    PS1
    PATH
    LS_COLORS
    KRB5CCNAME
    HOSTNAME
    HOME
    DISPLAY
    COLORS

But your output says to preserve ftp_proxy, http_proxy, and https_proxy (note that all the others are gone).

Note also that your sudoers file says

Defaults env_keep="http_proxy https_proxy ftp_proxy"

That's not there by default, so either you or someone else with access to the system added it. You could try commenting it out (sudo visudo, then add # in front of that line and save the file). Sudo should work fine after that.

If you're sure you need those variables, you can append (instead of clobbering and overwriting) env_keep by using += instead of =:

Defaults env_keep+="http_proxy https_proxy ftp_proxy"

Read man sudoers for a lot of detail on all this :)

share|improve this answer
    
I put the proxy stuff there myself. (this is my work computer and we are behind a proxy) *edit by there I dont mean in that file.. I set it up in my .bashrc file and environment variables. should I still comment it out in this file? –  jacobian May 16 '12 at 22:03
    
The Defaults line in /etc/sudoers is what keeps it from working. If you want sudo to work but also need those variables, use the last line I suggest with Defaults env_keep+=, that should allow you to use your additional variables and have sudo working correctly. –  roadmr May 17 '12 at 16:22

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.