2

i am using Ubuntu 14.04.5 LTS. I have gcc 4.8 and i want to upgrade it to gcc 4.9. I am trying to use the following commands i found online:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9

The first command failed so i found a solution: to use this sudo apt-add-repository "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu trusty main" command instead and it worked.

Then i run the second command ( sudo apt-get update) but it threw the error:

W: GPG error: http://ppa.launchpad.net trusty InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1E9377A2BA9EF27F
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://extras.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 16126D3A3E5C1192

W: Failed to fetch http://extras.ubuntu.com/ubuntu/dists/trusty/Release

W: Some index files failed to download. They have been ignored, or old ones used instead.

I tried to update the keys with the command sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F 16126D3A3E5C1192 but it threw the error

gpg: keyserver timed out
gpg: keyserver receive failed: keyserver error

What do i do next?

Kristopher Ives
  • 5,419
  • 2
  • 27
  • 36
  • you need the key from launchpad not ubuntu – ravery Jul 18 '17 at 14:29
  • what does it mean? i am new to linux – darkThoughts Jul 18 '17 at 14:30
  • signing keys ensure that files haven't been tampered with. when you added the repository URL manually you didn't get the key for them. go back to the page and see if they tell you how to add the key – ravery Jul 18 '17 at 14:33
  • The webpae is at [https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test](https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test) - if you click the button that says "Technical details about this PPA" you will find the signing key – Charles Green Jul 18 '17 at 14:37
  • What error message did you get when you ran `sudo add-apt-repository ppa:ubuntu-toolchain-r/test`? – Terrance Jul 18 '17 at 14:39
  • @CharlesGreen what do i do with this key? How do i install/import it? – darkThoughts Jul 18 '17 at 14:48
  • @Terrance the error it have me was: `Cannot add PPA: 'ppa:ubuntu-toolchain-r/test'. Please check that the PPA name or format is correct.` – darkThoughts Jul 18 '17 at 14:59
  • OK. Well, to install / import the key in the link that Charles provided, you run `sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA9EF27F` – Terrance Jul 18 '17 at 15:50
  • it still throws errors when i try to input the command sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA9EF27F. How do i just manually download gcc 4.9.4 and install it? – darkThoughts Aug 14 '17 at 14:30

0 Answers0