65

gcc-9 is just released.

I was wondering if there is a repository that allows me to install gcc 9 on Ubuntu 18.04 LTS (bionic)?

There seems to be repositories supporting disco:

https://packages.ubuntu.com/disco/gcc-9-base

But I liked to have it on the current LTS for a while.

N0rbert
  • 103,263
tinlyx
  • 3,328

2 Answers2

120

It is now available in ubuntu-toolchain-r too:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-9

If the add-apt-repository command cannot be found, run this:

sudo apt install software-properties-common

Above commands install just c compiler, if you need c++ compiler (g++) too

sudo apt install g++-9
ISanych
  • 1,316
15

I used a search for PPAs, using search on launchpad.net and found JonathonF's GCC 9.0 PPA. You can install this package by:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:jonathonf/gcc
sudo apt-get update
sudo apt-get install gcc-9
N0rbert
  • 103,263