Ubuntu apt proxy settings

Source: Internet
Author: User

You can set HTTP proxies for Apt-get in three ways
Method One
This is a temporary method that you can use if you only temporarily need to use Apt-get through an HTTP proxy.
Before using Apt-get, enter the following commands in the terminal (replace Yourproxyaddress and ProxyPort, depending on your situation).
Export Http_proxy=http://yourproxyaddress:proxyport
Method Two
This method uses the Apt.conf file under the/etc/apt/folder. You can use this method if you want Apt-get (not other applications) to always use the HTTP proxy.
Note: In some cases, the APT profile is not established during system installation. The following actions modify an existing configuration file or create a new profile, as appropriate.
sudo gedit/etc/apt/apt.conf
Add the following line to your apt.conf file (replace yourproxyaddress and ProxyPort, depending on your situation).
Acquire::http::P Roxy "Http://yourproxyaddress:proxyport";

Acquire::ftp::p Roxy "Ftp://127.0.0.1:8000/";

Acquire::https::p Roxy "Https://127.0.0.1:8000/";


Save the apt.conf file.
Method Three
This method adds two lines to the. bashrc file in your home directory. You can use this method if you want apt-get and other applications, such as wget, to use HTTP proxies.
Gedit ~/.BASHRC
Add the following at the end of your. bashrc file (replace yourproxyaddress and ProxyPort, depending on your situation).
Export Http_proxy=http://yourproxyaddress:proxyport
Save the file. Close the current terminal, and then open another terminal.
Test the agent with Apt-get update or any of the network tools you want to use. I use Firestarter to view active network connections.
If you modify the configuration file again to correct the error, remember to close the terminal and reopen it, and the settings will not take effect.

Ubuntu apt proxy settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.