I am trying to install version 6.3.0 of gcc. I need that one in particular and I do not know how to do it. Since if I run "sudo apt-get install gcc" it updates me to the latest version (7.4) and it does not work for me.
Thank you!
For getting gcc version 6.3.0, first you've to download the source:
wget https://github.com/gcc-mirror/gcc/archive/gcc-6_3_0-release.tar.gz
Then extract it:
tar xvzf gcc-6_3_0-release.tar.gz
Then install it according to their official documentation.
First check what versions of gcc are offered from the standard repositories:
apt-cache pkgnames |egrep gcc-[0-9]*$
If you see the one you want, just install it:
sudo apt-get install gcc-6
To run this version of gcc (different than the system default) for your project, you may:
Do NOT alter the update-alternatives for the gcc compiler to change the system default to the different gcc version. The system was build with a specific compiler version, and expects that version to be available when needed for kernel modules updates. Search this site for "update broke my computer" to see the consequences of a video module which fails to compile.
gcc-6
, which can be installed withsudo apt install gcc-6
. Later, you can call it withgcc-6
– Archisman Panigrahi Nov 07 '21 at 18:10