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?
- [Root@servermysql-5.0.56] # yuminstallgcc
- Loadedplugins: fastestmirror
- Loadingtransferspeedsfromcachedhostfile
- Couldnotretrievemirrorlisthttp: // response list.centos.org /? Release = 5 & arch = i386 & repo = addonserrorwas
- [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 ')>
- 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?
- [Root@servermysql-5.0.56] # vi/etc/resolv. conf
- Nameserver218.85.157.99
- 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