Posts

Showing posts with the label sudo

-E option to export environment variable to sudoer

Have you ever faced a problem adding ppa (Personal Package Archive) in your computer. If you are getting error like Please check your internet connection then probably the reason is sudo is not able to find proxy setting. This may happen if proxy is only set to .profile or .bashrc file. So to overcome this problem I have already wrote one post before. Here I am showing another option which is bit easier option. Here you have to add -E while running sudo (note: E is in capital letter). So -E option actually preserve the environment option . See the Sudo Manual for more detail. So to add ppa run the following command sudo -E add-apt-repository ppa:<paa_name> This should work now. Cheers APaul Source http://askubuntu.com/questions/212132/i-cant-add-ppa-repository-behind-the-proxy http://www.sudo.ws/sudo/man/sudo.html http://apurbapaul.blogspot.in/2012/09/adding-repository-behind-proxy-using.html

X Server and Display Problem With sudo

Image
Some time it happens that when you run any graphical window with sudo command like $sudo gedit /etc/apt/apt.conf you 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.\n Cannot open display: Run 'gedit --help' to see a full list of available command line options. or any error message involving launching x-server. To get rid of this kind of error message first open terminal and then run the following command $sudo visudo Then 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