1 问题描述
yum install cmake
使用yum安装cmake失败,失败信息如下:
[root@localhost]# yum install cmake
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:/root/anaconda3/lib/liblzma.so.5: version `XZ_5.1.2alpha' not found (required by /lib64/librpmio.so.3)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 14 2020, 14:45:30)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]If you cannot solve this problem yourself, please go to
the yum faq at:http://yum.baseurl.org/wiki/Faq
2 问题分析
从下面这句话分析,可以得出结论
/root/anaconda3/lib/liblzma.so.5: version `XZ_5.1.2alpha' not found (required by /lib64/librpmio.so.3)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 14 2020, 14:45:30)
本问题主要是yum与anaconda3冲突引起的,yum环境下的python版本为2.7,而anaconda3环境下的版本为3.x。
3 问题解决
删除原来的软连接,创建新的软连接,指向系统lib库
cd $CONDA_PREFIX/lib
rm libcurl.so.4 libcurl.so liblzma.so.5 liblzma.so
ln -s /lib64/liblzma.so.5.2.2 liblzma.so.5
ln -s liblzma.so.5 liblzma.so
ln -s /lib64/libcurl.so.4.3.0 libcurl.so.4
ln -s libcurl.so.4 libcurl.so
再次运行cmake安装命令显示如下:
yum install cmake
已加载插件:fastestmirror, langpacks, nvidia, priorities
Determining fastest mirrors* base: mirrors.aliyun.com* centos-sclo-rh: mirrors.bfsu.edu.cn* centos-sclo-sclo: mirrors.bfsu.edu.cn* extras: mirrors.aliyun.com* nux-dextop: li.nux.ro* updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 cmake.x86_64.0.2.8.12.2-2.el7 将被 安装
--> 解决依赖关系完成依赖关系解决==========================================================================================================================================================================================Package 架构 版本 源 大小
==========================================================================================================================================================================================
正在安装:cmake x86_64 2.8.12.2-2.el7 base 7.1 M事务概要
==========================================================================================================================================================================================
安装 1 软件包总下载量:7.1 M
安装大小:27 M
Is this ok [y/d/N]: y
Downloading packages:
cmake-2.8.12.2-2.el7.x86_64.rpm | 7.1 MB 00:00:06
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction正在安装 : cmake-2.8.12.2-2.el7.x86_64 1/1 验证中 : cmake-2.8.12.2-2.el7.x86_64 1/1 已安装:cmake.x86_64 0:2.8.12.2-2.el7 完毕!
最终安装成功,问题解决!