I know that there are similar questions for installation of clang-lower versions. But, I am trying to follow them to install clang-3.9 or 4.0 , but I am unable to do so on my Linux Mint 18.

First, I was only getting options upto clang-3.8 using

sudo apt-get install clang

followed by pressing tab twice.

Then, I followed this link and followed whatever is there in the first answer.

Now, I can see clang-3.9 and clang-4.0 when I press tab after typing sudo apt-get install clang.

Now, when I do

sudo apt-get install clang-4.0

I get the following error:-

 The following packages have unmet dependencies:
 clang-4.0 : Depends: libjsoncpp0 (>= 0.6.0~rc2) but it is not installable
E: Unable to correct problems, you have held broken packages.

1 Answer 1


Your version of Mint is based on Ubuntu 16.04, so you should use the sources for that (as documented on the repository's main page):

deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial main
deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial main
# 3.8
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.8 main
deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.8 main
# 3.9
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main
deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main

You shouldn't need the ubuntu-toolchain-r/test PPA.

  • Now, I have replaced the lines in the sources.txt file with the ones you mentioned. But, now I am getting another error similar to the previous one, but now it says :- > The following packages have unmet dependencies: > clang-4.0:i386 : Depends: binutils:i386 but it is not going to be installed >E: Unable to correct problems, you have held broken packages. And please forgive my unformatted comment, whenever I am pressing <Enter> , the comment is getting posted. Also tell me if I should edit my question to have a further question like this?
    – tonystark
    Commented Jan 4, 2017 at 17:00
  • Looking at the repositories, it appears that clang-4.0 isn't currently being built for amd64 for some reason. You should be able to install clang-3.9, but you'll have to wait for LLVM to make amd64 binaries available to install clang-4.0. Commented Jan 4, 2017 at 17:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .