Those who use Ubuntu in internet-restricted area such as college or office, probably will need proxy configuration for their apt-get command. Especially in the college, when every student given username and password for campus proxy to connect to the internet. Actually we just need to configure proxy or with/without authentication in apt.conf file. Here we go.
Assumptions
- Proxy server: proxy.server.edu
- Port: 443
- Username: myusername@mycollege.edu
- Password: mypassword
How To Configure
- Open Terminal.
- Perform command: sudo gedit /etc/apt/apt.conf
- Type the configuration text below.
- Save Gedit and exit.
- Test command sudo apt-get update when you are in the proxified area.
How To Revert Configuration
- Open Terminal.
- Perform command: sudo gedit /etc/apt/apt.conf
- Type a "#" sign without quotes in every beginning of line exactly before Acquire.
- Save Gedit and exit.
- Test command sudo apt-get update when you are not in proxyfied area.
Configuration Text
Given above assumptions, so our configuration will be like these.
Acquire::http::proxy "http://myusername@mycollege.edu:mypassword@proxy.college.edu:443" Acquire::https::proxy "myusername@mycollege.edu:mypassword@proxy.college.edu:443";