centos /lib64/libc.so.6: version `GLIBC_2.28' not found

2,372 阅读1分钟

解决方案:升级glibc到2.28版本

wget  https://mirror.bjtu.edu.cn/gnu/libc/glibc-2.28.tar.xz

tar -xf glibc-2.28.tar.xz -C /usr/local/

cd /usr/local/glibc-2.28/

mkdir build

cd build/

../configure --prefix=/usr/local/glibc-2.28

运行到…/configure --prefix=/usr/local/glibc-2.28时报错

报错1:

configure: error: in `/root/test/glibc-2.28/build’:
configure: error: no acceptable C compiler found in $PATH

yum install gcc -y

报错2:

These critical programs are missing or too old: make bison compiler
Check the INSTALL file for required versions.

解决方案: make bison compiler太过老旧。按下文方法解决。

centos 升级GCC编译器#

yum -y install centos-release-scl

yum -y install devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils

scl enable devtoolset-8 bash

echo "source /opt/rh/devtoolset-8/enable" >>/etc/profile

升级make#

wget http://ftp.gnu.org/gnu/make/make-4.2.tar.gz

tar -xzvf make-4.2.tar.gz

cd make-4.2

sudo ./configure

sudo make

sudo make install

sudo rm -rf /usr/bin/make

sudo cp ./make /usr/bin/

make -v

升级glibc-2.28#

wget  https://mirror.bjtu.edu.cn/gnu/libc/glibc-2.28.tar.xz

tar -xf glibc-2.28.tar.xz -C /usr/local

cd /usr/local/glibc-2.28/

mkdir build

cd build/

yum install -y bison

sudo ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin

make  //make 运行时间较长,可能会有半小时

make install

通过strings /lib64/libc.so.6 |grep GLIBC查询是否存在glibc-2.28版本

image

记CentOS7下升级gcc到9.3.0

背景 最近要编译安装graph-tool,所以得把gcc从4.8升级到9.3,因为gcc9.1及之后才支持C++2017

方法 1、下载源码包mirrors.aliyun.com/gnu/gcc/gcc…

2、解压,切入目录

[root@scentos DynamicGraph]# tar -zxvf gcc-9.3.0.tar.gz

[root@scentos DynamicGraph]# cd gcc-9.3.0/ 3、下载所需依赖

[root@scentos gcc-9.3.0]# ./contrib/download_prerequisites

[root@scentos gcc-9.3.0]# yum install glibc-devel.i686 libstdc++-devel.i686 4、编译安装

[root@scentos gcc-9.3.0]# ./configure --prefix=/usr --enable-multilib

[root@scentos gcc-9.3.0]# make

[root@scentos gcc-9.3.0]# make install 5、验证

[root@scentos gcc-9.3.0]# gcc --version

———————————————— 版权声明:本文为CSDN博主「coder_szc」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:blog.csdn.net/qq_37475168…