Network proxy settings for apt-Get In ubuntu (network proxy settings for terminal command lines)

Source: Internet
Author: User

The graphical proxy settings of the new software manager are clear. Here we will introduce the network proxy settings of the terminal command line, so that you can perform apt-Get through the proxy.

 

Method 1:

If you only want to temporarily use the HTTP proxy, you can enter: Export http_proxy = "http: // username: password @ proxy IP: proxy port" in the terminal before using apt-Get"

 

Method 2: (method 1 persistence)

If you want apt-Get and other applications to always use HTTP proxy, you can do this:

Edit in Terminal ~ /. Bashrc file: Vim ~ /. Bashrc

Add the following sentence at the end of the file:

Http_proxy = http: // username: password @ proxy address: proxy Port

Export http_proxy

 

Method 3:

If you only want apt-get to use a proxy, you can:

Add/etc/APT/apt. conf to the following line in the terminal,

Acquire: http: proxy "http: // yourproxyaddress: proxyport ";

Save and exit apt. conf.


4. For RedHat Linux, SET related environment variables in the profile file.

# Vi/etc/profile

Http_proxy = http: // username: password @ proxy server address: Port


In this way, you can access the Internet through the proxy under the terminal ^_^

Network proxy settings for apt-Get In ubuntu (network proxy settings for terminal command lines)

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.