Install yum command under linux

Solution: -bash: yum: command not found error

I 'm learning Linux recently, and today I accidentally deleted the yum command under the CentOS7 system, so Baidu wrote several articles, and truthfully followed their operations. I really didn't dare to say anything, so I had to do it manually...

Proceed as follows

first step:

http://mirrors.163.com/centos/7/os/x86_64/Packages/

Go to the above website to download the following RPM package

python-iniparse-0.4-9.el7.noarch.rpm

yum-metadata-parser-1.1.4-10.el7.x86_64.rpm

yum-3.4.3-168.el7.centos.noarch.rpm

yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm

After the download is complete, install it with the rpm command, as follows:

rpm -ivh --force --nodeps python-iniparse-0.4-9.el7.noarch.rpm
rpm -ivh --force --nodeps yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh --force --nodepsyum-3.4.3-168.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm

When installing here, you need to pay attention to it. You must add --force --nodeps, otherwise it will report an error and cannot install it.

At this point, when you enter the yum command, the following error occurs:

[here is picture 001]

Step 2:

Go to http://yum.baseurl.org/wiki

Download yum-3.4.3.tar.gz and decompress it in the directory you specify. The decompression command is as follows:

tar -zxvf yum-3.4.3.tar.gz# After decompression, go to the yum-3.4.3 directory

Enter the following command

./yummain.py update as shown below:

[here is picture 002]

Pay attention to the operation in the red box. After completion, you can try to enter yum and it will be OK, as shown below:

[here is picture 003]

Original address: http://blog.sina.com.cn/s/blog_643754960102w82m.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324131607&siteId=291194637