Loading
0

解决:-bash: yum: 未找到命令/-bash: yum: command not found
被墙跳转TG:@qianhenetwork QQ 851617266

301免备案跳转微信公众号
腾讯云服务器大促销。
华为服务器


前言:在通过yum命令安装软件时报错“-bash: yum: 未找到命令”或者 “-bash: /usr/bin/yum: 没有那个文件或目录”或者“-bash: yum: command not found”"-bash: /usr/bin/yum: No such file or directory"报错看没有安装yum命令,通常情况下linux系统会默认安装该命令,应该是yum命令被卸载删除导致。
原因:yum命令被卸载删除
注意:会安装很多组件,如果服务器是生成环境,请务必做好备份或快照,以免安装影响业务。
以Centos7.x和Centos8.x为例。
两种方法亲测有效。
执行如下命令查看是否有安装yum,若返回为空,则表示没安装

rpm -qa |grep yum

解决方法1:(适合Centos7.x)Centos8在下面。
1、下载阿里云的yum安装包安装:

wget  https://mirrors.aliyun.com/centos-vault/7.4.1708/os/x86_64/Packages/yum-3.4.3-154.el7.centos.noarch.rpm
wget  https://mirrors.aliyun.com/centos-vault/7.4.1708/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget  https://mirrors.aliyun.com/centos-vault/7.4.1708/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-42.el7.noarch.rpm

2、执行如下命令安装即可正常。

rpm -ivh yum*

解决方法2:(适合Centos7.x
若上面方法操作后还有问题,可参考如下使用163源安装试下。
1、登录服务器执行如下命令下载。

wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-10.el7.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-cron-3.4.3-168.el7.centos.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
rpm -ivh --force --nodeps python-urlgrabber-3.10-10.el7.noarch.rpm
rpm -ivh --force --nodeps yum-cron-3.4.3-168.el7.centos.noarch.rpm
rpm -ivh --force --nodeps yum-3.4.3-168.el7.centos.noarch.rpm
rpm -ivh --force --nodeps yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh --force --nodeps yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm

2、安装后执行yum命令,若能显示信息,则说明安装成功。
注意:若安装过程中出现“no module named yum”报错提示,请执行如下命令即可

wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/python-2.7.5-89.el7.x86_64.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/python-devel-2.7.5-89.el7.x86_64.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/python-libs-2.7.5-89.el7.x86_64.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/python-pycurl-7.19.0-19.el7.x86_64.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/python-setuptools-0.9.8-7.el7.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-10.el7.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/rpm-python-4.11.3-45.el7.x86_64.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-aliases-1.1.31-54.el7_8.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-plugin-protectbase-1.1.31-54.el7_8.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-updateonboot-1.1.31-54.el7_8.noarch.rpm
wget  http://mirrors.163.com/centos/7/os/x86_64/Packages/yum-utils-1.1.31-54.el7_8.noarch.rpm
rpm -ivh --force *.rpm --nodeps


Centos8.x误删yum命令后安装方法:
1、如果有dnf命令,则执行如下命令即可安装yum

dnf -y install yum

2、如果dnf命令也被误删除的话请参考如下方法
如下命令下载yum和dnf安装包及依赖包安装即可正常(亲测
注意:会安装很多组件,如果服务器是生成环境,请务必做好备份或快照,以免安装影响业务。

wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/platform-python-3.6.8-31.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/platform-python-pip-9.0.3-18.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/platform-python-setuptools-39.2.0-6.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/policycoreutils-2.9-9.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/policycoreutils-dbus-2.9-9.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/policycoreutils-devel-2.9-9.el8.i686.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/policycoreutils-devel-2.9-9.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/policycoreutils-newrole-2.9-9.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/policycoreutils-python-utils-2.9-9.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/policycoreutils-restorecond-2.9-9.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-asn1crypto-0.24.0-3.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-avahi-0.7-19.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-boom-1.2-2.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-cffi-1.11.5-5.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-chardet-3.0.4-7.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-configobj-5.0.6-11.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-configshell-1.1.28-1.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-cryptography-2.3-3.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-dateutil-2.6.1-6.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-dbus-1.2.4-15.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-decorator-4.2.1-2.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-dmidecode-3.12.2-15.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-dnf-4.2.23-4.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-dnf-plugin-post-transaction-actions-4.0.17-5.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-dnf-plugin-versionlock-4.0.17-5.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-dnf-plugins-core-4.0.17-5.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-dns-1.15.0-10.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-ethtool-0.14-3.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-firewall-0.8.2-2.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-gobject-base-3.28.3-2.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-gpg-1.13.1-3.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-hawkey-0.48.0-5.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-idna-2.5-5.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-iniparse-0.4-31.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-inotify-0.9.6-13.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-iscsi-initiator-utils-6.2.0.878-5.gitd791ce0.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-jwt-1.6.1-2.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-kmod-0.9-20.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-ldb-2.1.3-2.el8.i686.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-ldb-2.1.3-2.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-ldb-2.1.3-3.el8_3.i686.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-ldb-2.1.3-3.el8_3.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libcomps-0.1.11-4.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libdnf-0.48.0-5.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libipa_hbac-2.3.0-9.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libnl3-3.5.0-1.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libproxy-0.4.15-5.2.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-librepo-1.12.0-2.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libs-3.6.8-31.el8.i686.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libs-3.6.8-31.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libselinux-2.9-3.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libselinux-2.9-4.el8_3.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libsemanage-2.9-3.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libsss_nss_idmap-2.3.0-9.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libstoragemgmt-1.8.3-2.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libstoragemgmt-clibs-1.8.3-2.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libuser-0.62-23.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-libxml2-2.9.7-8.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-linux-procfs-0.6.2-2.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-magic-5.33-16.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-magic-5.33-16.el8_3.1.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-nftables-0.9.3-16.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-oauthlib-2.1.0-1.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-openipmi-2.0.27-1.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-perf-4.18.0-240.1.1.el8_3.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-perf-4.18.0-240.10.1.el8_3.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-perf-4.18.0-240.15.1.el8_3.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-perf-4.18.0-240.22.1.el8_3.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-perf-4.18.0-240.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-pip-wheel-9.0.3-18.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-ply-3.9-8.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-policycoreutils-2.9-9.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-pwquality-1.4.0-9.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-pycparser-2.14-14.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-pyparsing-2.1.10-7.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-pysocks-1.6.8-3.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-pyudev-0.21.0-7.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-pywbem-0.11.0-8.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-pyyaml-3.12-12.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-requests-2.20.0-2.1.el8_1.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-requests-oauthlib-1.0.0-1.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-rpm-4.14.3-4.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-rtslib-2.1.73-2.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-samba-4.12.3-12.el8.3.i686.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-samba-4.12.3-12.el8.3.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-samba-test-4.12.3-12.el8.3.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-schedutils-0.6-6.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-setools-4.3.0-2.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-setuptools-39.2.0-6.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-setuptools-wheel-39.2.0-6.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-six-1.11.0-8.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-slip-0.6.4-11.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-slip-dbus-0.6.4-11.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-solv-0.7.11-1.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-sss-2.3.0-9.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-sss-murmur-2.3.0-9.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-sssdconfig-2.3.0-9.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-subscription-manager-rhsm-1.27.16-1.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-syspurpose-1.27.16-1.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-talloc-2.3.1-2.el8.i686.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-talloc-2.3.1-2.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-tdb-1.4.3-1.el8.i686.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-tdb-1.4.3-1.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-test-3.6.8-31.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-tevent-0.10.2-2.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-urllib3-1.24.2-4.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-urwid-1.3.1-4.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/python3-varlink-29.0.0-1.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/dnf-4.2.23-4.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/dnf-automatic-4.2.23-4.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/dnf-data-4.2.23-4.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/dnf-plugin-subscription-manager-1.27.16-1.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/dnf-plugins-core-4.0.17-5.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/libdmmp-0.8.4-5.el8.i686.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/libdmmp-0.8.4-5.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/libdnf-0.48.0-5.el8.i686.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/libdnf-0.48.0-5.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/libedit-3.1-23.20170329cvs.el8.i686.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/libedit-3.1-23.20170329cvs.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/subscription-manager-1.27.16-1.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/subscription-manager-cockpit-1.27.16-1.el8.noarch.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/subscription-manager-plugin-ostree-1.27.16-1.el8.x86_64.rpm
wget https://vault.centos.org/8.3.2011/BaseOS/x86_64/os/Packages/subscription-manager-rhsm-certificates-1.27.16-1.el8.x86_64.rpm

下载完后执行命令安装:

rpm -ivh *.rpm --nodeps --force

按装后执行命令yum回车及dnf回车后可以看到能识别了。
执行如下命令更新缓存

yum makecache

更新成功则说明正常,也可以尝试安装一个小工具试下,例如

yum -y install iotop
dnf -y install iotop


也可参考 https://www.cnblogs.com/zjhblogs/p/16979199.html 处理。
题外话:(不要操作,这里只是做个说明)
若要卸载yum命令为:“ rpm -aq|grep yum|xargs rpm -e --nodeps
卸载python:

rpm -qa|grep python|xargs rpm -ev --allmatches --nodeps
whereis python |xargs rm -frv

301免备案跳转微信公众号
华为服务器
腾讯云服务器大促销。

声明:站长码字很辛苦啊,转载时请保留本声明及附带文章链接:https://www.zfcdn.xyz/showinfo-3-36222-0.html
亲爱的:被墙域名跳转TG:@qianhenetwork QQ:851617266,可否收藏+评论+分享呢?
上一篇:-bash: /usr/bin/chattr: Permission denied报错解决方法
下一篇:Ubuntu修改resolv.conf还原不生效解决方法