I'm trying to run a test under GCC 7. According to How to install gcc-7 or clang 4.0? on Ubuntu.SE, we can perform the following to install GCC 7 on Ubuntu:
add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update && apt-get install -y gcc-7
The command fails at the install:
# apt-get install -y gcc-7
...
E: Unable to locate package gcc-7
And trying 7.1:
# apt-get install -y gcc-7.1
...
E: Unable to locate package gcc-7.1
E: Couldn't find any package by glob 'gcc-7.1'
E: Couldn't find any package by regex 'gcc-7.1'
According to List all packages from a repository in ubuntu / debian on Server Fault, we can search a particular repo for a package with:
# grep ^Package: /var/lib/apt/lists/ppa.launchpad.net_*_Packages | grep gcc-7
#
But I am not sure if the command above is searching ppa:ubuntu-toolchain-r
.
I kind of pieced things together, but they are not working as expected. Either the Ubuntu.SE answer is wrong, the Server Fault search is failing, or I am doing something wrong.
(I don't have a Debain 8 machine available for gcc-7 package, and Fedora 25 appears to lack GCC 7. So I am pretty much stuck with Ubuntu).
What am I doing wrong? Or, how can I install GCC 7?
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.10
Release: 16.10
Codename: yakkety
Best Answer
To install
gcc-7
on ubuntu you should use this ppa:Then run:
apt-cache search gcc-7
sample output :
Install
gcc-7
: