centos7装完python3后,python2.7.5和python3同时存在,导致yum命令不可用
现象:
root@host~# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
/usr/1ib64/python2.7/site-packages/pycur1.so: undefined symbo1: cRpTo_num_1ocks
Please insta1l 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.Nov 20 2015.02:00:19)Gcc 4.8.5 20150623(Red Hat 4.8.5-4)]
If you cannot solve this problem yourself, please go to the yum fag at:
http://yum.baseur1.org/wiki/Faq
解决:
[root@host ~]# ldd /usr/lib64/python2.7/site-packages/pycurl.so
linux-vdso.so.1 => (0x00007ffc3cf18000)
libcurl.so.4 => /data/panwei/lib/libcurl.so.4 (0x00002acbe92d1000)
libpython2.7.so.1.0 => /lib64/libpython2.7.so.1.0 (0x00002acbe9558000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002acbe991e000)
libc.so.6 => /lib64/libc.so.6 (0x00002acbe9b3a000)
libssl.so.1.1 => /usr/local/openssl/lib/libssl.so.1.1 (0x00002acbe9efb000)
libcrypto.so.1.1 => /usr/local/openssl/lib/libcrypto.so.1.1 (0x00002acbea18e000)
libz.so.1 => /data/panwei/lib/libz.so.1 (0x00002acbea676000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002acbea88d000)
libutil.so.1 => /lib64/libutil.so.1 (0x00002acbeaa91000)
libm.so.6 => /lib64/libm.so.6 (0x00002acbeac94000)
/lib64/ld-linux-x86-64.so.2 (0x00002acbe8e9c000)
[root@host ~]#
[root@host ~]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/openssl/lib
/usr/local/bin/
/data/sellion/lib(此为自己的安装目录或使用目录,将其删除)
[root@host ~]# cp /etc/ld.so.conf /etc/ld.so.conf_bk20240112
[root@host ~]# vi /etc/ld.so.conf
[root@host ~]# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/openssl/lib
/usr/local/bin/
[root@host ~]# ldconfig 文件立即生效
删除其他的路径后即可以使用yum