GLIBC_2.27 GLIBC_2.25 GLIBC_2.28 CXXABI_1.3.9 GLIBCXX_3.4.20 GLIBCXX_3.4.21 not found

report error

/root/.cache/ms-playwright-go/1.35.1/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /root/.cache/ms-playwright-go/1.35.1/node)
/root/.cache/ms-playwright-go/1.35.1/node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /root/.cache/ms-playwright-go/1.35.1/node)
/root/.cache/ms-playwright-go/1.35.1/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by /root/.cache/ms-playwright-go/1.35.1/node)
/root/.cache/ms-playwright-go/1.35.1/node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /root/.cache/ms-playwright-go/1.35.1/node)
/root/.cache/ms-playwright-go/1.35.1/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /root/.cache/ms-playwright-go/1.35.1/node)
/root/.cache/ms-playwright-go/1.35.1/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /root/.cache/ms-playwright-go/1.35.1/node)

Install GLIBC_2.28

Upgrade gcc and make

Compiling glibc-2.28 requires a new version of make.

# 1. 安装GCC-8
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
 
# 2. 升级 make
wget 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
ln -sv /usr/local/make/bin/make /usr/bin/make

Download and compile glibc-2.28

wget http://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz
tar -xzvf glibc-2.28.tar.gz
cd /root/glibc-2.28/build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make && make install
# 日志最后会出现如下问题
# primary library!
# make[1]: *** [Makefile:111: install] Error 1
# make[1]: Leaving directory '/root/glibc-2.28'
# make: *** [Makefile:12: install] Error 2
 
# 再次查看系统内安装的glibc版本
strings /lib64/libc.so.6 |grep GLIBC_
 
# 测试
node -v
npm -v
You should restart this script from your build directory after you've
fixed all problems!
Btw. the script doesn't work if you're installing GNU libc not as your
primary library!
make[1]: *** [Makefile:111: install] Error 1
make[1]: Leaving directory '/root/glibc-2.28'
make: *** [Makefile:12: install] Error 2
$ strings /lib64/libc.so.6 |grep GLIBC_
GLIBC_2.23
GLIBC_2.24
GLIBC_2.25
GLIBC_2.26
GLIBC_2.27
GLIBC_2.28

Install CXXABI_1.3.9

There is still an error:

/root/.cache/ms-playwright-go/1.35.1/node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /root/.cache/ms-playwright-go/1.35.1/node)
/root/.cache/ms-playwright-go/1.35.1/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /root/.cache/ms-playwright-go/1.35.1/node)
/root/.cache/ms-playwright-go/1.35.1/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /root/.cache/ms-playwright-go/1.35.1/node)
yum install libstdc++.so.6 -y
# 查看动态链接库 -- 发现并没有需要的1.3.9
strings /usr/lib/libstdc++.so.6 | grep 'CXXABI'
# 下载需要的版本库,之后软连接到运行系统上
wget http://ftp.de.debian.org/debian/pool/main/g/gcc-8/libstdc++6_8.3.0-6_amd64.deb
ar -x libstdc++6_8.3.0-6_amd64.deb
tar -xvf data.tar.xz
cp usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 /usr/lib64/
find / -name "libstdc++*"
# 删除低版本库的软连接
rm -rf /usr/lib64/libstdc++.so.6
ll /usr/lib64/libstd*
ln -s /usr/lib64/libstdc++.so.6.0.25 /usr/lib64/libstdc++.so.6
 
# 检验
node -v
npm -v

Attached to install node

wget https://nodejs.org/dist/v18.16.1/node-v18.16.1-linux-x64.tar.xz
tar xvf node-v14.15.1-linux-x64.tar.xz
ln -s /root/node-v14.15.1-linux-x64/bin/node /usr/local/bin/node
ln -s /root/node-v14.15.1-linux-x64/bin/npm /usr/local/bin/npm
ln -s /root/node-v14.15.1-linux-x64/bin/npx /usr/local/bin/npx

npm install -g cnpm --registry=https://registry.npm.taobao.org
ln -s /root/node-v14.15.1-linux-x64/bin/cnpm /usr/local/bin/cnpm

reference

http://ftp.gnu.org/gnu/glibc/
https://www.cnblogs.com/dingshaohua/p/17103654.html
https://blog.csdn.net/legend818/article/details/129485301

Guess you like

Origin blog.csdn.net/lilongsy/article/details/131638656