Installing LLVM releases via apt-get: "Unable to locate package"

Hi - I’m trying to install LLVM top-of-tree via apt-get per instructions at https://apt.llvm.org but it’s not working for some reason.

$ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install libllvm-12-ocaml-dev libllvm12 llvm-12 llvm-12-dev llvm-12-doc llvm-12-examples llvm-12-runtime
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libllvm-12-ocaml-dev
E: Unable to locate package libllvm12
E: Unable to locate package llvm-12
E: Unable to locate package llvm-12-dev
E: Unable to locate package llvm-12-doc
E: Unable to locate package llvm-12-examples
E: Unable to locate package llvm-12-runtime

# Same errors for LLVM 11 and LLVM 13.

Does anyone know why?

1 Like

Try:

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main"
sudo apt-get update
sudo apt-get install -y llvm-11 llvm-11-dev clang-11 llvm-11-tools

Btw, neither LLVM 12 nor LLVM 13 have been released yet.

-Andrzej

1 Like

Thanks Andrzej, the commands you shared worked.

Though I believe my use case actually requires installing LLVM trunk, in which case LLVM 11 wouldn’t quite work.

I see - I’m curious why apt.llvm.org seems to suggest otherwise? There are sections with apt-get install commands for both LLVM 12 and 13.

LLVM 12 and LLVM 13 are currently development packages.

Release 12 has been tagged recently, so won’t be changing much between now and the official release.

LLVM 13 will be released in ~September (my personal, very rough estimate), so it’s likely to change a lot between now and the official release.

I hope that this makes sense!

1 Like