Author: Junner
Date: 2/26/2025
Solution Ref: https://unix.stackexchange.com/questions/410723/how-to-install-a-specific-version-of-gcc-in-kali-linux
When I'm building gf2x for NTL, it failed:
C++ style comments are not allowed in ISO C90
And I found the version with gcc -v
gcc version 14.2.0 (Debian 14.2.0-8)
My version is 14.2.0
at my Kali machine. We need to change it to a hopeful version.
Luckily, the building task works at my Pop!_OS machine, and the version is:
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
For installing a certain version of GCC/G++, the command is simple:
Set GCC priority of selecter: (the bigger number, the higher priority)
And run this to select which version you want to use now.
ββββThere are 2 choices for the alternative gcc (providing /usr/bin/gcc).
ββββ Selection Path Priority Status
ββββ------------------------------------------------------------
ββββ 0 /usr/bin/gcc-11 2 auto mode
ββββ 1 /usr/bin/gcc-11 2 manual mode
ββββ* 2 /usr/bin/gcc-14 1 manual mode
ββββPress <enter> to keep the current choice[*], or type selection number:
For my example, I typed 1
to select the target version.