centos7 install yum [reproduced]

Recently deleted python2 and yum on centos7, installed python3, the result is tragic, all kinds of trouble. It's awful if yum doesn't work. Still have to pretend. After successfully installing back python2.7, proceed to install yum. Refer to this article. The problems encountered during the practical operation are basically the same as the original text. The required package files have been sorted out, and the address is: https://download.csdn.net/download/xiaoanzi123/12254673

----------------------------------------split line-------- ---------------------------------

Reprinted article address: https://blog.csdn.net/yuang01/article/details/85066626  , learn to use reprint, if you have any questions, please contact me to delete.

The original text is as follows:

1. The
software installation is very troublesome after the rpm package is ready to be uninstalled by yum, so to reinstall yum, first find the download address of the rpm package.
Download address: http://mirrors.163.com/centos/7/os/x86_64/Packages/ (mine is centos7 64-bit, so this is the path, see the URL to know what each path is doing, download All you need is your own version, there are changes in each package minor version, pay attention to choose)

The required packages are as follows (there are dependencies between the order of the packages, it is recommended to install in order):

sudo rpm -ivh python-libs-2.7.5-76.el7.x86_64.rpm
sudo rpm -ivh python-2.7.5-76.el7.x86_64.rpm
sudo rpm -ivh python-iniparse-0.4-9.el7. noarch.rpm
sudo rpm -ivh python-pycurl-7.19.0-19.el7.x86_64.rpm
sudo rpm -ivh rpm-python-4.11.3-35.el7.x86_64.rpm (installation error, need to upgrade to rpm- 4.11.3-35.el7.x86_64)

Insert picture description here

2. The rpm upgrade method is as follows: The
query finds that the rpm version is as follows:

Insert picture description here

Therefore update the five packages of rpm to upgrade the
rpm : rpm-4.11.3-35.el7.x86_64.rpm
rpm-build-libs-4.11.3-35.el7.x86_64.rpm
rpm-libs-4.11.3- 35.el7.x86_64.rpm
rpm-build-4.11.3-35.el7.x86_64.rpm
rpm-sign-4.11.3-35.el7.x86_64.rpm

The upgrade commands are as follows: sudo rpm -Uvh rpm-4.11.3-35.el7.x86_64.rpm rpm-build-libs-4.11.3-35.el7.x86_64.rpm rpm-libs-4.11.3-35.el7. x86_64.rpm rpm-build-4.11.3-35.el7.x86_64.rpm rpm-sign-4.11.3-35.el7.x86_64.rpm

Upgrade result

Insert picture description here


Continue installation:
sudo rpm -ivh rpm-python-4.11.3-35.el7.x86_64.rpm

Insert picture description here


3. yum package installation
Then install the yum package
sudo rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

yum-3.4.3-161.el7.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
Note: the above two packages depend on each other,
use the command: rpm -ivh package name press The last two are installed in order in the above order because they need to be installed together because of interdependence. The command is as follows:

sudo rpm -ivh yum-3.4.3-161.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

The following error occurred during installation:

Insert picture description here

Download python-urlgrabber-3.10-9.el7.noarch.rpm and install:
sudo rpm -ivh python-urlgrabber-3.10-9.el7.noarch.rpm
succeeded.

Re-execute the installation command:
sudo rpm -ivh yum-3.4.3-161.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm

Then test the yum command and find that it is ready to use!
However, the story does not end. When using the yum command to install the software, I found that the yum source is not easy to use and cannot install the software. The source will be modified below.

4. Modify the yum source
4.1 Enter the system yum source directory
cd /etc/yum.repos.d
4.2 Download the yum source and upload it to the server
URL: http://mirrors.163.com/.help/CentOS7-Base -163.repo

4.3 Move the source to the yum source directory, each person's path is different, so the command is skipped here
4.4 Run makecache to generate cache
yum makecache
4.5 Run yum clean all
yum clean all
(equivalent to yum cleanheaders; yum cleanpackages)

4.6 Update YUM file
yum update
————————————————
Copyright Notice: This article is an original article of CSDN blogger "yuang01", follow the CC 4.0 BY-SA copyright agreement, please attach it for reprint Original source link and this statement.
Original link: https://blog.csdn.net/yuang01/article/details/85066626

Published 81 original articles · Like1 · Visits 30,000+

Guess you like

Origin blog.csdn.net/xiaoanzi123/article/details/104943028