小技巧(八) 误删除sqlite 导致yum、rpm工具不可用
昨天准备安装python3,有一些前置依赖的版本冲突了当时一抽筋了,删除了sqlite这个rpm包,导致rpm、yum工具都不能用了{{{(>_<)}}}[root@k8s-master01 ~]# rpm -qa sqlitesqlite-3.7.17-8.el7.x86_64模拟误删除rpm -e sqlite --nodeps然后完犊子了[root@k8s-master01 ~]
·
昨天准备安装python3,有一些前置依赖的版本冲突了
当时一抽筋了,删除了sqlite这个rpm包,导致rpm、yum工具都不能用了{{{(>_<)}}}
[root@k8s-master01 ~]# rpm -qa sqlite
sqlite-3.7.17-8.el7.x86_64
模拟误删除
rpm -e sqlite --nodeps
然后完犊子了
[root@k8s-master01 ~]# rpm -qa sqlite
错误:Failed to initialize NSS library
[root@k8s-master01 ~]# yum list
error: Failed to initialize NSS library
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
cannot import name ts
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.7.5 (default, Oct 30 2018, 23:45:53)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
解决方法
# 下载软件包
wget -c http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/23/x86_64/s/sqlite-3.11.0-3.fc23.x86_64.rpm
wget -c http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/23/x86_64/s/sqlite-libs-3.11.0-3.fc23.x86_64.rpm
#后续链接可能失效,下面提供找包的地址
#https://pkgs.org/
# 解压
rpm2cpio sqlite-3.11.0-3.fc23.x86_64.rpm | cpio -idmv
rpm2cpio sqlite-libs-3.11.0-3.fc23.x86_64.rpm | cpio -idmv
#这里会解压出来一个usr的目录
[root@k8s-master01 usr]# ls
bin lib64 share
#拷贝文件
cp usr/bin/sqlite3 /usr/bin/
cp usr/lib64/* /usr/lib64/
更多推荐
已为社区贡献17条内容
所有评论(0)