All operations are under root and the system version is Linux7.0 x86_64:
First, delete the original Yum
# rpm-aq|grep Yum|xargs rpm-e--nodeps
Second, download Yum, pay attention to their own Linux system version, what version is in the relevant version of the directory to download. But the small version of the directory is not in. If the version is 6.5, just go to 6 directory, version is 7.2, just into 7 directory.
Open the browser, login http://mirrors.163.com/centos/7/os/x86_64/Packages/, look for four files, as follows: (* symbol for the small version number, different versions)
1, yum-*.rpm
2, yum-metadata-parser-*.rpm
3, yum-plugin-fastestmirror-*.rpm
4, python-iniparse-*.rpm use wget download:
# wget http://mirrors.163.com/centos/7/os/i386/Packages/yum-3.2.29-60.el6.centos.noarch.rpm
# wget http://mirrors.163.com/centos/7/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
# wget http://mirrors.163.com/centos/7/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
# wget http://mirrors.163.com/centos/7/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
Third, after downloading, install Yum
Because the file is interdependent, so install the python-iniparse-*.rpm file first, and then install the other three files, so there will be no error
# RPM-IVH python-iniparse-0.3.1-2.1.el6.noarch.rpm
# RPM-IVH yum-*.rpm yum-metadata-parser-*.rpm yum-plugin-fastestmirror-*.rpm
Note: Rpm-ivh to install RPM--nodeps--force (plus--nodeps--force for compelling installations, regardless of dependency files)
After installation, you can use the RM command to delete the RPM files in the current directory (it is useless to install them).
Iv. Modification of source files
1, into the system yum the source of the directory:
#cd/ETC/YUM.REPOS.D
2, download Yum Source:
#wget Http://mirrors.163.com/.help/CentOS7-Base-163.repo
3, modify the repo Source: The file in the $releasever replace to 7 (7 refers to the Linux version)
#vi Centos6-base-163.repo
Note: After opening the file press I is entered modify mode, modify the ESC, and then press: Wq Save exit (: q! is not save exit)
4, renamed as the default repo
#mv Centos7-base-163.repo Centos7-base.repo (This step can be done without doing)
V. Run Makecache Build Cache
#yum Makecache
Six, run Yum clean all (equivalent to Yum cleanheaders; Yum cleanpackages);
#yum Clean All
Vii. update yum Files #yum update