Does it seem useless after export?
Problem Description:
yum " Could not retrieve mirrorlist http://mirrorlist.centos.org/? Release=5&arch=i386&repo=addons error "error:
[Plain]View Plaincopyprint?
- [[email protected] mysql-5.0.56]# Yum install gcc
- Loaded Plugins:fastestmirror
- Loading mirror speeds from cached hostfile
- Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=5&arch=i386&repo=addons error was
- [Errno 4] IOError: <urlopen error ( -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:cannot find a valid baseurl for repo:addons
found that the original is not configured resolv.conf, so to the/etc directory configuration resolv.conf join nameserver IP:
[Plain]View Plaincopyprint?
- [Email protected] mysql-5.0.56]# vi/etc/resolv.conf
- NameServer 218.85.157.99
- Search Localdomain
Save the resolv.conf and run the above command again.
Because recently in the research Linux system, the company environment is limited, the company unifies the Internet through the proxy, I installed the Linux server on the virtual machine of own computer, therefore set up the agent in the virtual machine, the computer IP is xxx.xxx.xxx.xx, where HTTP port 808.
After the search on the Web finally found the final solution, and now posted out to share with you!
If you are only temporarily using a proxy, enter the following command at the command line:
Export http_proxy= "http://210.45.72.XX:808"
For long-term use of agents:
You can set up a separate agent in Yum
is the parameter of the Yum source plus proxy= "Http://ip:PORT"
That is, add the following sentence to the/etc/yum.conf.
proxy=http://210.45.72.xx:808
Proxy_username=username
Proxy_password=password
Other than that:
/ROOT/.BASHRC Add:
Export http_proxy= "Http://username:[email protected]:808"
If it is authenticated via IP or computer's network card address, all username and password can be ignored.
Note: When you stop using the agent, change the file to the original. Especially if the export http_proxy= "http://210.45.72.XX:808" command is used,
To enter: unset http_proxy on the command line, remove the environment variable.
Because the essence of the export http_proxy= "http://210.45.72.XX:808" command is to write the settings behind export into the environment settings file.
Enter Env to see all the environment variable settings.
env >env.txt can output the environment variable to env.txt, and then open it to see it.
The unset variable can cancel an environment variable that was previously set.
Reprint Please specify source: http://blog.csdn.net/fwj380891124
Settings for Yum using proxy under CentOS