Installing clang version 15 or higher


For a project I am working on, I need clang-format version 15 or higher. The lastest version of clang on the AUR is version 14 though, as far as I can tell. Do you know of any alternative to compiling all of LLVM and Clang, which takes a long time on my machine?

Thanks for the help!

You could download the official release from the project.
I’d recommend adding the extracted archive to the PATH instead of installing it system-wide.

That sounds good. How would I remove the old packages, if a lot of others depend on it?

You shouldn’t.

If adding the “standalone” clang to PATH proves to create conflicts between the version, you may instead configure your project to explicitly use the version you want. This way, there should be no impact on your system.

Thanks, that clear things up. What if I want to update LLVM system-wide, is there an easy way to replace the pacman version with the latest release from github?

PATH is traversed from first to last entry, so setting up the external clang as first location it should work without further fiddling around.


On Arch is at v14, on AUR there are some older versions and llvm-git/clang-git

I updated a pkgbuild for you that isn’t on the AUR (and which I will not upload there) which install clang,llvm,lld,lldb in /opt (NB compiler-rt is not present)

I don’t suggest it when version are mismatched, for example qtcreator depends specifically on the clang version on which is build, in similar way compiler-rt

I’ve also modified the afromentioned pkgbuild to install in /usr instead of /opt (but I’m not suggesting to use it) PKGBUILD-AUR_fix/PKGBUILD at master · FabioLolix/PKGBUILD-AUR_fix · GitHub doing that it conflcits with 3 .so from the system; 2 from llvm-libs and 1 from gcc-libs (removed from the builded package), just to say that could led to unexpected behaviour from mismatch libraries or versions (I guess mesa could be affected among others)

1 Like

You can replace a package with a manually created one, but it will be tricky, and then you’ll also need to maintain it, plus possibly the packages depending on it.
If all you want is the latest version for a development project, i don’t think this is worth the trouble…