APT proxy connection

In some cases I needed to connect to internet through a proxy.
There are many ways to set the proxy data into browsers or other applications, and sometimes the APT needs an own proxy configuration.

If your APT does not connects to internet and you must use a proxy, you need to execute this command:

# echo "Acquire::http::proxy \"http://username:pwd@proxyIP:port\";" >> /etc/apt/apt.conf

where username and pwd are your username and password used to login into proxy server, proxyIP and port are the IP address and port of your proxy server.

If the file /etc/apt/apt.conf is not already present into system, this command creates the file and writes into it.
If the file is already present, it can have a standard line for proxy settings, that you have to modify with your settings or to delete after the execution of the command.

After that, you can test the connection of APT with:

# apt-get update

and you should have a normal update of the repositories.

Enjoy! 😉


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: