How to update default GCC on a CentOS 7.9?
Hi,
I updated GCC on my CentOS 7.9 from 4.8.5 to 9 by doing this:
And then I typed this:
and the "gcc -v" command does return version 9, but every time I restart the dedicated server it reverts to version 4.8.5 How to enable gcc by default? Cordially
yum install centos-release-scl -y
yum clean all
yum install devtoolset-9-* -yAnd then I typed this:
scl enable devtoolset-9 bashand the "gcc -v" command does return version 9, but every time I restart the dedicated server it reverts to version 4.8.5 How to enable gcc by default? Cordially
-
Hi @cPRex Since this morning I haven't been idle, I tried to update and it seems to be a success To start, I remove what I installed by mistake: yum remove devtoolset-9-*
Then I :949 2022-03-14 12:17:50 wget https://ftp.gnu.org/gnu/gcc/gcc-9.2.0/gcc-9.2.0.tar.gz 950 2022-03-14 12:20:03 tar -xvf gcc-9.2.0.tar.gz 951 2022-03-14 12:20:20 cd gcc-9.2.0 952 2022-03-14 12:20:27 ./configure 953 2022-03-14 12:21:51 sudo yum install glibc-devel.i686 954 2022-03-14 12:21:59 sudo yum install libgcc.i686 955 2022-03-14 12:22:15 ./configure 956 2022-03-14 12:22:39 gcc -v 957 2022-03-14 12:22:46 make
the make is very slow, you have to wait about 1h30958 2022-03-14 14:33:50 history 959 2022-03-14 14:33:55 gcc --version
The version was still the same, I rebooted the server and then it's ok[16:20:57] root@ns [~]# gcc --version gcc (GCC) 9.2.0 Copyright " 2019 Free Software Foundation, Inc. Ce logiciel est un logiciel libre; voir les sources pour les conditions de copie. Il n'y a AUCUNE GARANTIE, pas m"me pour la COMMERCIALISATION ni L'AD"QUATION " UNE T"CHE PARTICULI"RE. [16:23:52] root@ns [~]# [16:23:52] root@ns [~]# gcc -v Utilisation des specs internes. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/lto-wrapper Cible : x86_64-pc-linux-gnu Configur" avec: ./configure Mod"le de thread: posix gcc version 9.2.0 (GCC) [16:25:22] root@ns [~]#
That's how it is for those who don't know, or for me who needs to read the tutorial again, I'll come back here and read if I need to. I hope it will go well for the future and that it will work. [Edit] I replaced the ./configure and make with:./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-plugin --enable-initfini-array --disable-libgcj --with-system-zlib make -j 8
Greetings0 -
gcc --version gcc -v
returned the new version but not him:/usr/bin/gcc -v
I replaced the ./configure and make with:./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-plugin --enable-initfini-array --disable-libgcj --with-system-zlib make -j 8
faster, in 30 minutes it's good, instead of 1h30 now is ok :[21:43:33] root@ns# /usr/bin/gcc -v Utilisation des specs internes. COLLECT_GCC=/usr/bin/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/lto-wrapper Cible : x86_64-pc-linux-gnu Configur" avec: ./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-plugin --enable-initfini-array --disable-libgcj --with-system-zlib Mod"le de thread: posix gcc version 9.2.0 (GCC) [21:45:39] root@ns #
I hope that for the future there will be no problem Before the changes, it displayed this config:[19:53:24] root@ns # /usr/bin/gcc -v Utilisation des specs internes. COLLECT_GCC=/usr/bin/gcc COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper Target: x86_64-redhat-linux Configur" avec: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux Mod"le de thread: posix gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)0
Please sign in to leave a comment.
Comments
3 comments