How to install GCC6.3.x & G++6.3.x on Ubuntu 16.04
GCC 6.3 is available in Jonathon F's Launchpad repository:
https://launchpad.net/~jonathonf/+archive/ubuntu/gcc-6.3
This PPA could be used for installing GCC 6.3 from package, rather than from source, which should usually be the last resort (do note, it is not an official Ubuntu PPA).
For installing GCC 6.3 on Ubuntu 16.04, follow this procedure:
-
Remove any previous gcc-6 version installed:
sudo apt-get remove --purge gcc-6 g++-6 gcc-6-multilib
sudo apt autoremove
-
Add the gcc-6.3 PPA:
sudo add-apt-repository ppa:jonathonf/gcc-6.3
sudo apt-get update
-
Install the specific gcc-6.3 version,
6.3.0-21ubuntu1~16.04.york0
in our case:VER=6.3.0-21ubuntu1~16.04.york0 && sudo apt-get install gcc-6-base=$VER gcc-6=$VER g++-6=$VER cpp-6=$VER libgcc-6-dev=$VER libstdc++-6-dev=$VER libasan3=$VER
-
Check the version of the just installed gcc with
gcc-6 -v
. Expected:gcc version 6.3.0 20170628 (Ubuntu 6.3.0-21ubuntu1~16.04.york0)
Related videos on Youtube
TonyParker
Updated on September 18, 2022Comments
-
TonyParker over 1 year
I want to install GCC and G++ 6.3 version. As MATLAB only support this compiler. On launchpad it is not available.
I could not find any link which could describe way to install. I could install 6.5 from PPA. Can someone explain how to install from source ?
-
saeed masoomi over 4 yearsI tried your solution but I got this error
E: Version '6.3.0-21ubuntu1~16.04.york0' for 'gcc-6-base' was not found