centos服务器 /1ib64/libm.so.6: version “GLIBc 2.27’ not found 异常

centos服务器 /1ib64/libm.so.6: version “GLIBc 2.27’ not found 异常

问题

在服务器使用open3d时,报错缺失GLIBC_2.27,因为后续操作出问题会导致服务器挂,所以最好先备份一下。

0052e0bc64f7c8486254b3b86d60c99

解决

查询glibc版本

输入指令查询系统glibc版本,我是更新后解决的,之前查询时版本是GLIBC_2.17,所以需要升级

ldd --version

image-20250103093318311

strings /lib64/libc.so.6 | grep GLIBC

image-20250103093455740

升级gcc

因为centos7,所以对应GLIBC版本过低,升级需要先升级gcc8

# 安装devtoolset-8-gcc
yum install -y devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils
# 设置环境变量
echo "source /opt/rh/devtoolset-8/enable" >> /etc/profile
source /etc/profile
# 安装gcc 
$wget https://mirrors.tuna.tsinghua.edu.cn/gnu/gcc/gcc-8.5.0/gcc-8.5.0.tar.gz
# 如果清华下载慢也可以换腾讯
# wget https://mirrors.cloud.tencent.com/gnu/gcc/gcc-8.5.0/gcc-8.5.0.tar.gz

解压
tar -zxvf gcc-8.5.0.tar.gz
cd gcc-8.5.0
 
 配置
./contrib/download_prerequisites
 
mkdir build && cd build/
../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib

# 编译
make

#安装
make install
 
#检查
gcc -v

image-20250103094400448

升级make

# 下载
wget --no-check-certificate https://ftp.gnu.org/gnu/make/make-4.3.tar.gz
# 解压
tar -xzvf make-4.3.tar.gz 
cd make-4.3/
 
# 配置
./configure  --prefix=/usr/local/make
# 安装
make
make install
 
# 软链接
cd /usr/bin/
mv make make.bak # backup
ln -sv /usr/local/make/bin/make /usr/bin/make

安装GLIBC_2.27

# 下载
wget --no-check-certificate https://ftp.gnu.org/gnu/glibc/glibc-2.27.tar.gz

# 解压
tar -xzvf glibc-2.28.tar.gz
cd glibc-2.28
 
# 配置
mkdir build && cd build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin

# 安装
make
make install

在安装后会发现系统报错,说安装失败,这个问题不用管,直接查询系统,可以看到已经升级到2.28了

make[1]: [Makefile:111: install] Error 1
make[1]: Leaving directory ‘/opt/glibc-2.27’
make: [Makefile:12:install] 错误 2
ldd --version

image-20250103095207430

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值