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

  • 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
    – daisy
    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

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

Environment variables to preserve:

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 :)

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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