Ubuntu – Error when trying to run an app with sudo or gksudo

nautilussudo

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

Best Answer

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

Related Question