Silviu-Marius Ardelean's blog

a software engineer's web log

Ubuntu – How to fix update errors for a server behind of a proxy

If you’re behind of a proxy server and the IP address has changed (or proxy it’s a new node in your network topology) then probably when you’re trying to update your binaries then you’ll get a list of errors.
[bash]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/oneiric-security/multiverse/i18n/Translation-en_US Unable to connect to 192.168.120.240:3128:
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/oneiric-security/multiverse/i18n/Translation-en Unable to connect to 192.168.120.240:3128:
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/oneiric-security/restricted/i18n/Translation-en_US Unable to connect to 192.168.120.240:3128:
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/oneiric-security/restricted/i18n/Translation-en Unable to connect to 192.168.120.240:3128:[/bash]

This happens because you’re unable to connect to Ubuntu mirrors. In order to fix this issue, you have to edit apt.conf file settings.
– Check the proxy settings in apt.conf file:
[bash]
my-user@my-server:/#sudo -s
root@my-server:/# view /etc/apt/apt.conf
[/bash]

– Update the new proxy IP and port (ex. http://192.168.230.99:3128):
[bash]
root@my-server:/# vi /etc/apt/apt.conf
Acquire::http::Proxy “http://192.168.230.99:3128”;
[/bash]
If you need user and password for logging to the Proxy server this can be achieved in most cases by using the following layout.
Acquire::http::Proxy "http://username:password@your_proxy_address:proxy_port";

– Finally, you may enjoy running the update commands:
[bash]
root@my-server:/# apt-get update
root@my-server:/# apt-get upgrade
[/bash]

, , , , ,
26/03/2012 at 7:34 PM Comments (0)