莫名其妙的出现yum无法使用,提示No such file or directory
可能是yum被误删除了,根据提示需要重新安装一下yum,检查版本
cat /etc/redhat-release
CentOS Linux release 7.8.2003 (AltArch)
通过centos对应版本在随便一个镜像站点找到安装包,
https://mirrors.bfsu.edu.cn/centos-altarch/7.8.2003/os/aarch64/Packages/
获取到yum-3.4.3-167.el7.centos.noarch.rpm的下载链接,通过rpm直接安装,rpm -ivh --nodeps https://mirrors.bfsu.edu.cn/centos-altarch/7.8.2003/os/aarch64/Packages/yum-3.4.3-167.el7.centos.noarch.rpm
在次运行yum,又出现状况,提示:No module named sqlitecachec
猜测是yum自有数据库问题,通过删除重建,解决问题,详细操作如下:
cd /var/lib/rpm/
rm -i __db.*
rpm --rebuilddb
通过镜像站点找到yum元数据管理安装包
rpm -ivh --force --nodeps https://mirrors.bfsu.edu.cn/centos-altarch/7.8.2003/os/aarch64/Packages/yum-3.4.3-167.el7.centos.noarch.rpm https://mirrors.bfsu.edu.cn/centos-altarch/7.8.2003/os/aarch64/Packages/yum-metadata-parser-1.1.4-10.el7.aarch64.rpm
安装后yum恢复正常。
yum运行依赖python,系统自带python2.7,如果又异常或者版本又变化,需要修改 /etc/bin/yum文件,执行对应的python
[root@hdp02 sysbench-1.0.20]# yum
Loaded plugins: product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
You need to give some command
Usage: yum [options] COMMAND
List of Commands:
check Check for problems in the rpmdb
check-update Check for available package updates
clean Remove cached data
deplist List a package's dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade downgrade a package
erase Remove a package or packages from your system
fs Acts on the filesystem data of the host, mainly for removing docs/lanuages for minimal hosts.
fssnapshot Creates filesystem snapshots, or lists/deletes current snapshots.
groups Display, or use, the groups information
help Display a helpful usage message