2

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
  • 121
  • 1
  • 2
  • "The following packages have unmet dependencies" -- See this two q&a -- https://askubuntu.com/questions/563178/ and https://stackoverflow.com/questions/26571326/. – Biswapriyo Oct 26 '19 at 04:53
  • I was having the same trouble with WSL 2 (hence finding this on Google). First I did `apt install clang-9 lld-9 clangd-9`. Then I installed the preliminary build dependencies at https://lldb.llvm.org/resources/build.html (`apt install build-essential swig python2.7-dev libedit-dev libncurses5-dev`) to try to compile it manually later. Today I tried one more `apt update` and `apt install lldb-9` worked! – Aaron B Nov 07 '19 at 03:23

1 Answers1

2

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

pvbecker
  • 21
  • 3
  • This is a nice attempt to get yourself some badly needed points. When posting something like this, include the critical information from said article because if the link goes dead (they often do), this answer becomes worthless. I am going to upvote you anyways. – Señor CMasMas Aug 10 '20 at 16:33
  • Oh! thanks for that, just edited. new to this, sorry for that. – pvbecker Aug 18 '20 at 16:15