Configure YUM in Linux
This topic describes how to configure the yum source. Although there are many methods on the internet, each of them has problems, so you can write your own configuration process. Directory Overview step download installation package uninstall built-in yum install yum package add yum summary step download installation package my current server version of redhat6, so the downloaded installation package should also be the corresponding linux6 installation package, the yum source of 163 is configured here. Wget http://mirrors.163.com/centos/6/ OS /i386/Packages/yum-3.2.29-69.el6.centos.noarch.rpmwget http://mirrors.163.com/centos/6/ OS /i386/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpmwget http://mirrors.163.com/centos/6/ OS /i386/Packages/yum-metadata-parser-1.1.2-16.el6.i686.rpmwget http://mirrors.163.com/centos/6/ OS /i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm uninstall built-in yum rpm-aq | grep yum | xargs rpm-e -- nodeps install yum package note order rpm-ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm rpm-ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm -- note that the next two are install rpm-ivh yum-3.2.29-69.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm together to add the yum switch path cd/etc/yum. repos. d/download the file wget http://mirrors.163.com/.help/centos6-base-163.repoedit file vim CentOS6-Base-163.repo content as follows
# 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/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&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/i386/#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contribgpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
Test whether yum install perl-DBI has been installed successfully. It is not difficult to summarize the installation method. Note that you must select the correct version when downloading the rpm package, there may also be some trouble when configuring repo later, but it is easy to solve.