$ sudo apt update
$ sudo apt install g++-12 -y
$ sudo apt install --reinstall libc6-dev
-y
$ sudo update-alternatives --install /usr/bin/gcc
gcc /usr/bin/gcc-11 11
$ sudo update-alternatives --install /usr/bin/gcc gcc
/usr/bin/gcc-12 12
$ sudo update-alternatives --install /usr/bin/g++ g++
/usr/bin/g++-11 11
$ sudo update-alternatives --install /usr/bin/g++ g++
/usr/bin/g++-12 12
$ gcc --version
gcc (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
Copyright (C) 2022 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.
$ g++ --version
g++ (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
Copyright (C) 2022 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.
|