I am running Ubuntu 16.04 LTS and I want to install a newer version of GCC, specifically gcc-7 which released May 2, 2017. There is a package for it in the Toolchain test builds ppa, but the Ubuntu version listed next to it is 7-20170407-0ubuntu2
(I have no idea what this corresponds to). I tried following the instructions in this question and this question and had the same issues. They are from before gcc 7.1 officially had a release, so I am not sure if the instructions would change at all now that it is out?
Even after adding the ppa I get the following:
user@computer:~$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
user@computer:~$ sudo apt-get update
user@computer:~$ sudo apt install gcc-7
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-7
Any idea on how I can install the new gcc? I am not looking to upgrade my distribution. I am also not above building from source, however that is kind of my last resort because managing that all by hand is just annoying.