Jump to content

Help with proxy on Ubuntu 11.10


Avitar

Recommended Posts

Hey everyone. I´m currently on campus here in my university and they restrict their network with a proxy. Ubuntu Software Center and the terminal somehow cannot use the system-wide proxy settings and cannot seem to download the files. Can anyone help me with this?

Link to comment
Share on other sites


  • Replies 1
  • Views 2k
  • Created
  • Last Reply

Thank you everyone for not helping <_< I´m sure if it was a girl you would´ve been jumping to her rescue. :angry:

Oh well, solution found [no thanks to you guys!!!]

Setting up apt-get to use a http-proxy

These are three methods of using apt-get with a http-proxy.

How to login a proxy user

If you need to login to the Proxy server this can be achieved in most cases by using the following layout in specifying the proxy address in http-proxy. (substitute your details for username, password, yourproxyaddress and proxyport)

http_proxy=http://username:password@yourproxyaddress:proxyport

Temporary proxy session

This is a temporary method that you can manually use each time you want to use apt-get through a http-proxy. This method is useful if you only want to temporarily use a http-proxy.

Enter this line in the terminal prior to using apt-get (substitute your details for yourproxyaddress and proxyport).

export http_proxy=http://yourproxyaddress:proxyport

APT configuration file method

This method uses the apt.conf file which is found in your /etc/apt/ directory. This method is useful if you only want apt-get (and not other applications) to use a http-proxy permanently.

On some installations there will be no apt-conf file set up. This procedure will either edit an existing apt-conf file or create a new apt-conf file.

gksudo gedit /etc/apt/apt.conf
Add this line to your /etc/apt/apt.conf file (substitute your details for yourproxyaddress and proxyport).

Acquire::http::Proxy "http://yourproxyaddress:proxyport";
Save the apt.conf file.

BASH rc method

This method adds a two lines to your .bashrc file in your $HOME directory. This method is useful if you would like apt-get and other applications for instance wget, to use a http-proxy.

gedit ~/.bashrc
Add these lines to the bottom of your ~/.bashrc file (substitute your details for yourproxyaddress and proxyport)

http_proxy=http://yourproxyaddress:proxyportexport http_proxy
Save the file. Close your terminal window and then open another terminal window or source the ~/.bashrc file:

source ~/.bashrc
Test your proxy with sudo apt-get update and whatever networking tool you desire. You can use firestarter or conky to see active connections.

If you make a mistake and go back to edit the file again, you can close the terminal and reopen it or you can source ~/.bashrc as shown above.

source ~/.bashrc

apt-get and ubuntu software center works now :)

Please note, anybody who ever reads this, that you need to do the four commands over everytime you reboot.

Link to comment
Share on other sites


Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...