Configure network proxy for Yum and wget

Source: Internet
Author: User
Tags centos server
Generally, for internal network security of enterprises in medium and large enterprises, the external internet is usually connected through proxy, so that the Linux server on the Intranet cannot directly connect to the external Yum server, it is inconvenient to install the software (after all, there are too many dependent packages for some software ).

Here, I only record the Yum and wget network proxy configurations of the centos server in my personal work environment.

1. Yum proxy configuration: 1. Modify the/etc/yum. conf file and append the following content to the end:

Sudo VI/etc/yum. conf

[Main] cachedir =/var/Cache/Yum/$ basearch/$ releaseverkeepcache = 0 debuglevel = 2 logfile =/var/log/yum. logexactarch = 1 obsoletes = 1 gpgcheck = 1 plugins = 1installonly_limit = 5bugtracker_url = http://bugs.centos.org/set_project.php? Project_id = 23 & ref = http://bugs.centos.org/bug_report_page.php? Category = yumdistroverpkg = centos-release # configure proxy http_proxy = http: // proxy IP Address: Port # Yes, add; (No, Please omit the following ;) proxy_username = proxy username proxy_password = proxy Password
2. Test Yum proxy configuration

Yum list

If the yum data is obtained correctly after the preceding command is executed, the yum proxy configuration is successful.

2. wget download and configuration proxy method 1: directly set the HTTP proxy in the wget command

Wget http://www.sina.com-e use_proxy = yes-e http_proxy = proxy IP: Port

HTTPS Proxy

Wget -- no-check-certificate http://www.sina.com-e use_proxy = yes-e http_proxy = proxy IP: Port

Method 2: Add a configuration file

Create a. wgetrc file in the current user's directory and write the proxy server information

VI ~ /. Wgetrc

# Configure proxy http_proxy = http: // proxy IP Address: Port ftp_proxy = http: // proxy IP Address: Port # If yes, add it. (If NO, omit the following ;) proxy_username = proxy username proxy_password = proxy password # indicates enabling proxy use_proxy = on

Configure network proxy for Yum and wget

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.