Set yum proxy in CentOS

Source: Internet
Author: User
Proxy servers must be set for Internet access in the school environment. Therefore, newly installed CentOS cannot be operated using yum or wget. The following figure shows your configuration settings: Usingyumwithaproxyserver ------------------------------------------------------------- Toenableyumoperationstouseaproxy.

Proxy servers must be set for Internet access in the school environment. Therefore, newly installed CentOS cannot be operated using yum or wget. The configuration settings are as follows:

The configuration documents in English on the network are as follows:

Using yum with a proxy server
---------------------------------------
To enable yum operations to use a proxy server you shoshould first add the following parameter to/etc/yum. conf this is the yum setting after configuring the proxy network

Proxy = http: // yourproxy: 8080/

Edit the/etc/yum. conf file

This is our specific proxy settings: add the following in the last line of the yum. conf file:

Yes # the comment line serves as a description to help us understand the role of this line.


Where yourproxy is the name of the proxy server you want to access and 8080 is the proxy port. If the server requires authentication you can specify the login credentials like:

Proxy = http: // username: password @ yourproxy: 8080/

---------------------------------------

The rpm package manager makes use of the proxy environment variable. This can be set system wide in/etc/profile or user specific in ~ /. Bash_profile ::

Export http_proxy = http: // yourproxy: 8080/
Export ftp_proxy = http: // yourproxy: 8080/

---------------------------------------

To use wget throug a proxy server add the following lines to/etc/wgetrc this is the wget setting after configuring the proxy network

Http_proxy = http: // yourproxy: 8080/
Ftp_proxy = http: // yourproxy: 8080/

 

 

In both cases, login information can be set like in the example above.
Related Article

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.