How to install GCC6.3.x & G++6.3.x on Ubuntu 16.04

15,151

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:

  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)

Share:
15,151

Related videos on Youtube

TonyParker
Author by

TonyParker

Updated on September 18, 2022

Comments

  • TonyParker
    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
    saeed masoomi over 4 years
    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