Previously, Redhat EL5 server has been used as a server, but the RedHat Yum needs to be updated online, so it will be charged. Later I changed centos 6.2, but I want to use its Yum function, you also need to make some other changes. The specific content is as follows:
1. First, because the company needs to use a proxy to access the Internet, you need to configure Yum to connect to the Internet. The specific method is as follows:
Modify the/etc/yum. conf file and add the Proxy Server IP address and port to the end of the file. If there is a user name and password, add it as well. If there is no user name and password, then you don't need:
proxy=http://ip:portproxy_username=usernameproxy_password=password
2. Change the yum source. We use the centos image source of Netease:
# cd /etc/yum.repos.d/# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo# vi CentOS6-Base-163.repo
Sohu Yum Source: wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
If Step 2 wget is unavailable, you can directly obtain the. Repo configuration file in the browser.
Edit the file, replace all the $ releasever in the file with the version number, that is, 6 is last saved! Or directly copy the following memory to the CentOS6-Base-163.repo file (modified ):
########################################################################## CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client. You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the# remarked out baseurl= line instead.##[base]name=CentOS-6 - Base - 163.combaseurl=http://mirrors.163.com/centos/6/os/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=osgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#released updates[updates]name=CentOS-6 - Updates - 163.combaseurl=http://mirrors.163.com/centos/6/updates/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updatesgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#additional packages that may be useful[extras]name=CentOS-6 - Extras - 163.combaseurl=http://mirrors.163.com/centos/6/extras/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extrasgpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages[centosplus]name=CentOS-6 - Plus - 163.combaseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplusgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users[contrib]name=CentOS-6 - Contrib - 163.combaseurl=http://mirrors.163.com/centos/6/contrib/$basearch/#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contribgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6#########################################################################
3. Clear Yum cache:
# Yum clean all
# Yum makecache # cache the software package information on the server to a local machine to speed up searching and installing software
# Yum install Vim * # test whether the domain name is available
Now, redhat6 can use centos Yum source to install software online!
4. Install the plug-in:
Finally, you can install a plug-in, yum install Yum-fastestmirror-y, which automatically selects the fast source.
If I put many sources in that directory, how can I know which one is currently used? If you haven't changed yum. conf, read the file starting with time in the/var/Cache/Yum/folder.