aarch64 Centos7 No such file or directory和No module named sqlitecachec

本文详细介绍了在CentOS 7.8中解决yum无法使用的问题,包括重新安装yum,处理数据库错误,以及更新元数据管理器的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

莫名其妙的出现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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值