cp /root/mydownload/make-r.2.tar.gz /usr/src cd /usr/src tar -xf make-4.2.tar.gz cd make-4.2 ./configure make -j4 make install cd /usr/bin mv make make3.8 cp /usr/local/bin/make /usr/bin
已经升级为4.2版本
1
make -v
2. 升级GCC
查看当前版本:4.8.5
1
gcc --version
下载8.1.0版本
1 2 3
cd /root/mydownload wget http://www.netgull.com/gcc/releases/gcc-8.1.0/gcc-8.1.0.tar.gz
安装依赖
1
yum -y install bzip2
编译安装GCC8.1.0版本
1 2 3 4 5 6 7 8 9 10 11 12 13
cp /root/mydownload/gcc-8.1.0.tar.gz /usr/src cd /usr/src tar -xf gcc-8.1.0.tar.gz cd gcc-8.1.0 ./contrib/download_prerequisites mkdir build cd build ../configure --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib make -j4 make install cd /usr/bin/ mv gcc gcc4.8.5 cp /usr/local/bin/gcc /usr/bin
[root@DockersHK lib64]# ldd --version ldd (GNU libc) 2.17 Copyright (C) 2012 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 由 Roland McGrath 和 Ulrich Drepper 编写。
下载2.30版本
1 2
[root@DockersHK ~]# cd /root/mydownload [root@DockersHK ~]# wget http://ftp.gnu.org/pub/gnu/glibc/glibc-2.30.tar.xz
vim /usr/bin/yum 修改第一行的python为python2.7.5 vim /usr/libexec/urlgrabber-ext-down 同理
安装GLIBC 2.30的依赖包
1
yum -y install bison texinfo
1 2 3 4 5 6 7 8
[root@DockersHK Python-3.8.0]# cd /root/mydownload/ [root@DockersHK mydownload]# tar -xf glibc-2.30.tar.xz [root@DockersHK mydownload]# cd glibc-2.30 [root@DockersHK glibc-2.30]# mkdir build [root@DockersHK glibc-2.30]# cd build/ [root@DockersHK build]# ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin [root@DockersHK build]# make -j4 && make install
最后提示了两个错误项,但不会影响GLIBC的版本升级。
1 2 3 4 5 6 7 8
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] Error1 make[1]: Leaving directory '/root/mydownload/glibc-2.30' make: *** [Makefile:12:install] 错误 2 [root@DockersHK build]#
可以发现GLIBC已经升级为2.30版本
1 2 3 4 5 6
[root@DockersHK build]# ldd --version ldd (GNU libc) 2.30 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Roland McGrath and Ulrich Drepper.