Configure yum agent in CentOS

Source: Internet
Author: User

Configure yum agent in CentOS

Problem description:

When CentOSyum appears, "cocould not retrieve into listhttp: // your list.centos.org /? Release = 5 & arch = i386 & repo = addonserror "error:

[Plain] view plaincopyprint?
  1. [Root@servermysql-5.0.56] # yuminstallgcc
  2. Loadedplugins: fastestmirror
  3. Loadingtransferspeedsfromcachedhostfile
  4. Couldnotretrievemirrorlisthttp: // response list.centos.org /? Release = 5 & arch = i386 & repo = addonserrorwas
  5. [Errno4] IOError: <urlopenerror (-3, '\ xe5 \ x9f \ x9f \ xe5 \ x90 \ x8d \ xe8 \ xa7 \ xa3 \ xe6 \ x9e \ x90 \ xe6 \ x9a \ x82 \ xe6 \ x97 \ xb6 \ xe5 \ xa4 \ xb1 \ xe8 \ xb4 \ xa5 ')>
  6. Error: Cannotfindavalidbaseurlforrepo: addons
It turns out that resolv. conf is not configured, so configure resolv. conf In The/etc directory to add nameserver IP: [plain] view plaincopyprint?
  1. [Root@servermysql-5.0.56] # vi/etc/resolv. conf
  2. Nameserver218.85.157.99
  3. Searchlocaldomain
Save resolv. conf and run the preceding command again.

Recently I have been studying the LInux system. The company's environment is limited. The company uniformly accesses the Internet through proxy. I installed a Linux server on my computer's virtual machine, so I set up a proxy in the virtual machine, the ip address of the computer is xxx. xxx. xxx. xx, where the http port is 808.

After searching on the internet, I finally found the Final Solution. Now I am posting it to share with you!

If you are using a proxy temporarily, enter the following command in the command line:
Export http_proxy = "http://210.45.72.XX: 808"

For long-time use of proxies:
You can set a proxy in yum.
Is the yum Source Parameter plus proxy = "http: // ip: PORT"
Add the following sentence to/etc/yum. conf.
Proxy = http://210.45.72.XX: 808
Proxy_username = username
Proxy_password = password
In addition:
/Root/. bashrc:
Export http_proxy = "http: // username: password@210.45.72.XX: 808"
All usernames and passwords can be ignored if they are authenticated by ip addresses or computer network card addresses.
Note: When you stop using the proxy, you need to change the modified file to the original. Especially if you use the export http_proxy = "http://210.45.72.XX: 808" command,
Enter unset http_proxy in the command line to remove the environment variable.
Because the export http_proxy = "http://210.45.72.XX: 808" command is essentially to write the settings after the export into the environment settings file.
Enter env to view all environment variable settings.
Env> env.txt: You can output environment variables to env.txt and env.txt.

Unset variables can cancel environment variables that have been set.

Reprinted please indicate the source: http://blog.csdn.net/fwj380891124

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.