Posts

Showing posts with the label env_keep

Adding Defaults env_keep in visudo

Image
In my previous two blog I have discussed problem with add-apt-repository behind proxy and x-server problem with sudo command. In both cases solution was to add Defaults env_keep in sudoer's file. like Defaults env_keep=" DISPLAY XAUTHORITY" (for gedit) Defaults env_keep="http_porxy" (for adding repository) Problem is, if you add line like above, one that is las line work. Because above command actually keep envs that at the last line and reset all others. To add more than one env variable you can use any of the following methods. First method: You can specify, as many env variable as you want, in side the quote, separated by space. For example: Defaults env_keep="http_proxy ftp_proxy DSPLAY XAUTHORITY" Second Method: You can use "+=" sign instead of "=" sign in the command. For example: Defaults env_keep+="DSPLAY XAUTHORITY" Defaults env_keep+="http_proxy" Both are equally good method. You c...

Adding Repository Behind Proxy Using add-apt-repository

Image
  If you are behind proxy then you may have noticed that adding repository is not easy in Ubuntu. Even though $sudo apt-get-update or $sudo apt-get-install kind of command work, $sudo add-apt-repository don't work. To get rid of this problem you have to add one line at the end of the sudoer's file. Use the following code in terminal. $sudo visudo And then add the following line at the end of the file Default env_keep="http_proxy" It should work now. Cheers A.Paul

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