问题描述
尝试使用yum时出现依赖包缺少依赖版本的问题,主要问题时在安装openGauss时,通过脚本创建omm用户和dbgrp组导致的,如果用户和组是提前创建好的就不会出现这样的问题
报错:version `GLIBCXX_3.4.26’ not found
报错信息
Traceback (most recent call last):
File "/usr/bin/yum", line 57, in
from dnf.cli import main
File "/usr/lib/python3.9/site-packages/dnf/__init__.py", line 30, in
import dnf.base
File "/usr/lib/python3.9/site-packages/dnf/base.py", line 29, in
import libdnf.transaction
File "/usr/lib64/python3.9/site-packages/libdnf/__init__.py", line 8, in
from . import error
File "/usr/lib64/python3.9/site-packages/libdnf/error.py", line 13, in
from . import _error
ImportError: /opt/software/om/script/gspylib/clib/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/lib64/libdnf.so.2)
检查/opt/software/om/script/gspylib/clib/libstdc++.so.6 文件是否有对应版本,通过以下命令检查会发现确实没有报错中的 3.4.26
strings /opt/software/om/script/gspylib/clib/libstdc++.so.6 | grep GLIBCXX
解决办法
在/usr/lib64/路径下也有 libstdc++.so.6 文件,检查该文件是否包含所需版本
strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
/usr/lib64/libstdc++.so.6 有所需版本
将 /opt/software/om/script/gspylib/clib/ 路径下的 libstdc++.so.6 文件删除,或重命名做备份后(mv 命令是重命名做备份),将 /usr/lib64 中的文件复制到 /opt/software/om/script/gspylib/clib/ 路径下
mv /opt/software/om/script/gspylib/clib/libstdc++.so.6 /opt/software/om/script/gspylib/clib/libstdc++.so.6.bak
cp /usr/lib64/libstdc++.so.6 /opt/software/om/script/gspylib/clib/
/usr/lib64/libstdc++.so.6 没有所需版本
下载 libstdc++.so.6.0.26(下载链接:https://pan.baidu.com/s/1-h9_7ICGOWLMYQvxtwSDgg 提取码:1234) 将文件上传到 /opt/software/om/script/gspylib/clib/ 路径下
将 libstdc++.so.6 软连接更改到 libstdc++.so.6.0.26 文件
mv /opt/software/om/script/gspylib/clib/libstdc++.so.6 /opt/software/om/script/gspylib/clib/libstdc++.so.6.bak
ln -s /opt/software/om/script/gspylib/clib/libstdc++.so.6.0.26 /opt/software/om/script/gspylib/clib/libstdc++.so.6
完成后再重新执行yum命令
yum clean all
报错:undefined symbol: EVP_md2, version OPENSSL_1_1_0
报错信息
Traceback (most recent call last):
File "/usr/bin/yum", line 57, in
from dnf.cli import main
File "/usr/lib/python3.9/site-packages/dnf/__init__.py", line 30, in
import dnf.base
File "/usr/lib/python3.9/site-packages/dnf/base.py", line 29, in
import libdnf.transaction
File "/usr/lib64/python3.9/site-packages/libdnf/__init__.py", line 8, in
from . import error
File "/usr/lib64/python3.9/site-packages/libdnf/error.py", line 13, in
from . import _error
ImportError: /usr/lib64/libldap.so.2: undefined symbol: EVP_md2, version OPENSSL_1_1_0
检查报错文件,发现其中 libssl.so.1.1 软连接指向的是 openGauss 路径下的 libssl
ldd /usr/lib64/libldap.so.2
解决办法
打开环境变量配置文件,将openGauss安装时自动添加的环境变量中的 LD_LIBRARY_PATH 注释
vi /etc/profile
修改后使用 source /etc/profile 会发现还是报错,需要重启系统才可以
source /etc/profile
reboot now
重启后再使用 yum 就没有问题了