3

I am trying to install the last stable version with the script in the page:
https://apt.llvm.org/

However I have the following error:

Reading package lists... Done
+ apt-get install -y clang-9 lldb-9 lld-9 clangd-9
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 lldb-9 : Depends: llvm-9-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Is there any else to do before? I have installed LLVM 8 without any error before.

Mac Fly
  • 131

1 Answers1

3

I believe you can find some further info into this: https://solarianprogrammer.com/2017/12/13/linux-wsl-install-clang-libcpp-compile-cpp-17-programs/ Just did the whole processing described in this article and it worked pretty fine. Hope it helps.

EDIT: As mentioned below, here are the critical steps described on the tutorial:

update apt:

sudo apt update

sudo apt upgrade

install dependencies for running clang/llvm:

sudo apt install build-essential xz-utils curl

download binaries for the linux distribution you're targeting (check on the project's website for the "name" you're after or simply use the lastest release):

curl -SL http://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | tar -xJC .

mv clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04 clang_9.0.0

sudo mv clang_9.0.0 /usr/local

add binaries to PATH: export PATH=/usr/local/clang_9.0.0/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/clang_9.0.0/lib:$LD_LIBRARY_PATH