Error getting access to LLVM Debian/Ubuntu nightly packages

Trying to access LLVM Debian/Ubuntu nightly packages

I am on 14.04 and they give this info:

The goal is to provide Debian and Ubuntu nightly packages ready to be installed with minimal impact on the distribution. Packages are available for amd64 and i386 and for both the stable, qualification and development branches (currently 3.9, 4.0 and 5.0).

The packages provide LLVM + Clang + compiler-rt + polly + LLDB + LLD + libFuzzer

Trusty (14.04) - Last update : Wed, 22 Mar 2017 08:38:03 UTC / Revision: 298477

deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty main
deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty main
# 3.9 
deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main
deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main
# 4.0 
deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main
deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main

I have tried going in Ubuntu Software Centre and adding the deb line for both 3.9 and 4.0. But after sudo apt-get update I get an error:

W: GPG error: http://apt.llvm.org llvm-toolchain-trusty-3.9 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 15CF4D18AF4F7421

There is some way to install this without Ubuntu Software Centre, but I don't know how to find the ppa:user/ppa-name as talked about here


Solution 1:

Each one of these repositories has it's own key which you should add before updating your lists. See https://apt.llvm.org/

E.g: if you add this one to your sources:

deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty main

Then you should also add the related key to this component, which is:

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -

So, if you add all lines for trusty, then you should add all three related keys to them, It will make your error goes away.


For stable brunch (V3), source:

 deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main

 wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -

For qualification branch (V4), source:

deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -

Solution 2:

I was getting the same error. I fixed it by installing launchpad-getkeys:

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install launchpad-getkeys

Once it's installed, run:

sudo launchpad-getkeys
sudo apt-get update

Your key errors should be gone.