For the command
sudo apt-get update
I get following error:
W: Failed to fetch http://ch.archive.ubuntu.com/ubuntu/dists/maverick-updates/multiverse/binary-i386/Packages.gz
407 Proxy Authentication Required (The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
I am running Ubuntu 10.10 installed on Windows XP using VirtualBox. For Internet connections I am using proxy server with an authentication. I tried to use gnome-network-proxy
tool to set proxy settings system-wide.
After that /etc/environment
has been updated by http_proxy
variable with the format http://my_proxy:port/
, there were no authentication data.
I checked this with Firefox. Browser asked my for login and password and everything was working fine. It was unfortunately not the case for apt-get. I have also tried to do as described here. Unfortunately it does not work.
May it be somehow related to the fact that a proxy is in a Windows domain, any ideas?
My proxy name is http-proxy. Is '-' a special character here?
For my corporate network I was given by my administrator the proxy name in the format:
For our Windows network our username is in the format:
For example:
This was added to the following NEW file (it doesnt exist by default):
The following text was added:
If you are using an anonymous proxy then you don't need your login credentials:
Save the file and then checked that all was ok with:
I have found that USERNAME and PASSWORD entered into the "Network Proxy" applet does not get stored into the apt.conf file you must manually add the username and password in the /etc/apt/apt.conf file.
The "Network Proxy" applet only stores the hostname and the port.
The basic syntax is
If you are using Windows usernames and password follow this advice:
(windows users use
/
not\
)If you are using Windows strong/complex password with special characters you must use the URL encoding for the values, for example an "@" in the password would be "%40".
Try setting
http_proxy
to http://user:pass@proxyserver:port/edit:
If setting
http_proxy
does not work try editingapt.conf
. InUbuntu
apt.conf
is fragmented in/etc/apt/apt.conf.d/
directory.In this directory edit
/etc/apt/apt.conf.d/01ubuntu
:or try setting it using Synaptic: Settings -> Preferences -> Network
And then set your proxy settings in "Manual proxy configuration".
I'm behind a MS ISA proxy and I'm using Cntlm Authentication Proxy; in the
apt.conf
I have 4 lines; I've read somewhere that the last line must be empty, but I'm not sure about it. It works perfectly:cntlm has a discovery option that helps find the right config to work with the NTLM auth of your network, try this:
copy and paste the results in /etc/cntlm.conf
restart cntlm
How to apply apt-get update or install in Ubuntu ? I was behind a proxy server and after installing Ubuntu i coulden`t update or install anything using the apt-get command. After searching i found that The apt package has been changed, now there is no more apt.conf on /etc/apt directory.
What i did to resolve this issue is the follow :
Open terminal and the file
and add at the bottom of the file these 2 lines :
Now save and exit, Now you will be able to update, upgrade or install packages in Ubuntu
Open terminal and add the following lines to /etc/apt/apt.conf.
Add these 2 lines:
Save and exit.
Now
apt-get update
and should work behind a proxy, but you will notice that still something is not working, that is theadd-apt-repository
command.To be able to add repository behind a proxy, type the following commands:
Now you can add repositories in Lucid and Natty using LANG=C add-apt-repository
Example:
root@ubuntu:~# LANG=C add-apt-repository ppa:motumedia/mplayer-daily
Via Unixmen
This one has been working for me!!
(adding proxy manually from the GUI via system-settings->network etc should work) But if doesn't and you export env variable from the terminal:
and again for https:
Most important to add the -E: To run
sudo apt-get install
orsudo apt-get update
you must run:The "-E" use your user environment variables for the root (sudo) , for that matter the http_proxy/https_proxy you've just exported.
Hope it helps :)
With a BlueCoat proxy, for me the format of the
apt.conf
file was required to look like:^ ^ ^ ^ Blank line after 3rd proxy line, do not enter this line. ^ ^ ^ ^
This one-liner solution worked for me: