I'm trying to set Network Proxy to use my LAN's internet connection to update packages.
while the proxy settings works on my firefox, but the package manager still cannot connect to Internet. I have set proxy in System >> Preferences >> Network Proxy
and I have entered the user/pass for the proxy in 'Details' too.
How can I make sure that the Proxy Network is applied correctly?
First of all make sure you click on "Apply system-wide..." whenever you change proxy settings in the gnome-network-properties (
System -> Preferences -> Network Proxy
). This sets http_proxy and related environment variables. This should be available to all programs started after the proxy setting is "Applied system-wide...". To be really sure, you can logout and back-in to double-check this.If you open a terminal and use the command
set | grep -i proxy
you would see the relevant environment variables set. Ideally this should be enough.However, I have faced situations where all the above still doesn't work: Synaptic or
apt-get
(over commandline) can't connect to the internet through the proxy even after it is set in the above way. In such cases, one solution is to add a file in/etc/apt/apt.conf.d
with specific proxy configuration for apt (this will be used by apt-get, aptitude, synaptic and Ubuntu software center).Follow the below steps:
Create /etc/apt/apt.conf.d/40proxy
gksudo gedit /etc/apt/apt.conf.d/40proxy
Put the following contents into it - modify the contents to suit your situation.
Acquire::http::Proxy "http://proxy.site.com:8080";
If you have a user-name & password you could encode the same in the proxy url (like so,
http://username:[email protected]:8080
) or you can use something like ntlmaps for better control.More info could be found here.
Have you clicked the Apply System Wide (highlighted) button? If you don't proxy settings are local to your Gnome session and therefore when
root
goes off to download packages, it won't use the same network settings.There's a bunch of good answers above that will help you if you're having problems (which is what your question implies). However, this is an answer to the narrow question of checking whether the Network proxy settings have been applied:
Method 1: Start a new shell (xterm), then check the environment variables:
Note that existing shells will not have updated environment variables. So if you're executing a command that looks at environment variables for its proxy settings, start it in a shell created after the changes to the proxy settings.
Method 2: Use
gconftool
to query the gconf settings (which are stored under~/.gconf
):As others have noted, be sure that your browser and other apps are set to "Use System Proxy Settings".
If you try:
from the command line, then if you get HTML back the proxy is working.
To set a proxy temporarily you can fire up a terminal and enter
export http_proxy="http://yourproxy:yourport"
Then start the program, e.g. Synaptic for package management. The console might give you helpful output on what goes wrong.
I'm using a proxy also, and I had to set the proxy settings specifically for Synergy and update manager (using Synergy: Configuration->Preferences->Network). There's no option there to use the "system settings", and even if it should work, changing the proxy server at the system level never made me able to update :-(
I'm interested in a solution that make it work though :-)
anyone thought to check/add settings to:
/etc/environment
try it with:
http_proxy="http://user:password@proxyserver:port" https_proxy="http://user:password@proxyserver:port" ftp_proxy="http://user:password@proxyserver:port"
Click on "Apply System-Wide..." and check that all your internet applications are set to use the system proxy. There's nothing more to it than this. There's no need to tamper with configuration files and start-up scripts.
Applying system-wide is not enough ! I think maybe ISA Server or maybe synaptic reset connection for each query to the web this issue that login and password authentication lie down. Or maybe ISA Server do not accept to transmit query that do not answer on HTTP protocol, but It's not my favorite.