centos 7 系统更新最新版(2023-11-28) gcc、node简单记录

复制代码
安装nodejs最新版步骤记录

gcc升级最新版
wget http://ftp.gnu.org/gnu/gcc/gcc-13.2.0/gcc-13.2.0.tar.gz
tar -xf gcc-13.2.0.tar.gz 
cd gcc-13.2.0
./contrib/download_prerequisites
cd gcc-build-13.2.0/
../configure --enable-checking=release --enable-languages=c,c++ --disable-multilib 
make  -j4      (会较久)
用make -j带一个参数,可以把项目在进行并行编译,比如在一台双核的机器上,
完全可以用make -j4,让make最多允许4个编译命令同时执行,这样可以更有效的利用CPU资源
make install
gcc -v

更新libstdc++.so软链接
#查找编译gcc时生成的最新动态库
find / -name "libstdc++.so*"
#将找到的动态库libstdc++.so.6.0.28复制到/usr/lib64
cp  /usr/local/lib64/libstdc++.so.6.0.32  /usr/lib64
#切换工作目录至/usr/lib64,删除原来的软连接, 将默认库的软连接指向最新动态库。
cd /usr/lib64
rm -rf libstdc++.so.6
ln -s libstdc++.so.6.0.32 libstdc++.so.6


升级make
wget https://mirrors.aliyun.com/gnu/make/make-4.3.tar.gz
cp make-4.3.tar.gz /opt
cd /opt/
tar -zxf make-4.3.tar.gz 
cd make-4.3/
mkdir build
cd build
../configure --prefix=/usr && make && make install
make -v


升级glibc-2.31
cd /opt
wget https://mirrors.aliyun.com/gnu/glibc/glibc-2.31.tar.gz
tar -zxf glibc-2.31.tar.gz
cd glibc-2.31/
cat INSTALL | grep -E "newer|later"
mkdir build
cd build
../configure  --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin --disable-sanity-checks --disable-werror
yum install python3
make -j6
make install
验证
strings /lib64/libc.so.6 | grep GLIBC
ll /lib64/libc.so*


升级node到最新版
wget https://nodejs.org/dist/v20.10.0/node-v20.10.0-linux-x64.tar.xz
tar -xf node-v20.10.0-linux-x64.tar.xz
vim /etc/profile
source /etc/profile
node -v
复制代码

 

glibc执行make install 可能会报如下错误,但是不影响后续node安装

 

升级后截图如下:

 

posted @   叮伱格斐呃  阅读(602)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
Live2D
欢迎阅读『centos 7 系统更新最新版(2023-11-28) gcc、node简单记录』
点击右上角即可分享
微信分享提示