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 ?


GCC 6.3 is available in Jonathon F's Launchpad repository:

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:

  1. Remove any previous gcc-6 version installed:

    sudo apt-get remove --purge gcc-6 g++-6 gcc-6-multilib
    sudo apt autoremove

  2. Add the gcc-6.3 PPA:

    sudo add-apt-repository ppa:jonathonf/gcc-6.3
    sudo apt-get update

  3. 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

  4. 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)

  • I tried your solution but I got this error E: Version '6.3.0-21ubuntu1~16.04.york0' for 'gcc-6-base' was not found – saeed masoomi Oct 26 '19 at 19:05

I see that the repository is no longer available! For me making a copy of "gcc-7"/"g++-7" with the name "gcc"/"g++" at the source folder solved the problem!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.