The clang package is all you need. If you want to link in the standard library statically, you'll need libstdc++-static as well, just like when using GCC. The LLVM project has its own stdlib implementation, but Fedora uses the GNU one by default (like most distros). (There's also glibc-static for libc, but it's not a good idea to statically link glibc.) Although, for development, you'll probably also want to install clang-tools-extra (which has useful tools such as clang-format and clangd). Answer from gmes78 on reddit.com
๐ŸŒ
Clang
clang.llvm.org โ€บ get_started.html
Getting Started: Building and Running Clang - LLVM
On Linux, you may need GCC runtime libraries (e.g. crtbeginS.o, libstdc++.so) and libstdc++ headers. In general, Clang will detect well-known GCC installation paths matching the target triple (configured at build time (see clang --version); overriden by --target=) and use the largest version.
Discussions

apt - How to install clang-10 on Ubuntu 20.4 - Unix & Linux Stack Exchange
I upgraded my Linux box from Ubuntu 18.04 to 20.04. I need to install the clang suite of compilers and the apt command is giving me errors. I've searched many possible solutions but so far none of ... More on unix.stackexchange.com
๐ŸŒ unix.stackexchange.com
June 16, 2020
c++ - How to install Clang 11 on Debian - Stack Overflow
I am trying to compile a C++ project on a PC with "Debian GNU/Linux 10". The project requires clang, so I installed it with: sudo apt-get install clang But I run into the following error: More on stackoverflow.com
๐ŸŒ stackoverflow.com
How to install clang in win, wsl or linux
clang is what i should use but im unable to install, clang on windows or wsl2 or linux. there are some guides which worked but debugging didnt workโ€ฆ More on reddit.com
๐ŸŒ r/C_Programming
10
0
July 21, 2024
Building Clang 18.1.5 on Linux with support for std modules
does xmake support importing std modules? If so, figure out how to enable it. These links will help you get started with cmake if you're interested: https://libcxx.llvm.org/Modules.html https://www.kitware.com/import-std-in-cmake-3-30/ More on reddit.com
๐ŸŒ r/cpp
7
9
May 18, 2024
๐ŸŒ
UbuntuHandbook
ubuntuhandbook.org โ€บ home โ€บ howtos โ€บ install clang 21, 22, or 23 in ubuntu 26.04 | 24.04 | 22.04
Install Clang 21, 22, or 23 in Ubuntu 26.04 | 24.04 | 22.04 | UbuntuHandbook
This simple tutorial shows how to install the most recent Clang compiler 23, 22, or 21 in current Ubuntu 26.04, Ubuntu 24.04, Ubuntu 22.04, and Ubuntu 20.04 LTS and correct the deprecated repository settings.
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ installation โ€บ how to install clang on debian
How to Install Clang on Debian | Baeldung on Linux
January 30, 2024 - Clang is the C/C++/Objective-C compiler for the Low-Level Virtual Machine (LLVM) project. It is an alternative to existing compilers like GCC, offering many advantages, such as faster compilation speed, low memory use, and meaningful error messages. In this tutorial, weโ€™ll explore the LLVM design architecture, learn how to install Clang and LLVM from Debian and LLVM repositories, test various versions of Clang, and verify the executables were all compiled with the correct compiler.
Find elsewhere
๐ŸŒ
eUKhost
eukhost.com โ€บ home โ€บ how to install clang on ubuntu 22.04 & 20.04
How to install Clang on Ubuntu 22.04 & 20.04 - eukhost
December 20, 2024 - Learn how to install Clang on Ubuntu 22.04 and 20.04 with easy steps. Follow our guide for smooth setup and efficient development.
๐ŸŒ
LLVM
apt.llvm.org
LLVM Debian/Ubuntu packages
apt-get install clang-21 lldb-21 lld-21 To install all key packages:
๐ŸŒ
AddictiveTips
addictivetips.com โ€บ home โ€บ how to install clang on ubuntu
How to Install Clang Libraries on Ubuntu: A Step-by-Step Guide
August 28, 2024 - Ubuntu will begin to download and install all Clang 12 packages on your computer upon pressing the Y key. This will only take a couple of seconds. When the process is complete, close the terminal window, or keep it open and use Clang 12.
Top answer
1 of 4
44

Installing the llvm and build-essential packages, as you have done, does not cause clang or clang++ to be installed. For that, you must install one of the clang packages, depending on which version of clang and clang++ you want.

16.04

In Ubuntu 16.04, your options are clang-3.5, clang-3.6, clang-3.7, and clang-3.8.

14.04

In Ubuntu 14.04, your options are clang-3.3 , clang-3.4 , and clang-3.5 .

You can install them in the Software Center, or with:

sudo apt-get update
sudo apt-get install clang-3.n

(Replacing n with the desired sub-version, of course.)

12.04

If you're running Ubuntu 12.04, there's only one package that provides clang and clang++, so it's just called clang .

2 of 4
27

18.04 (Bionic)

I visited http://apt.llvm.org/bionic/dists/ (i.e. bionic distributions).
I determined that 6.0 was the latest major version of the toolchain.

I assume that you'll want the linker, lld, also.

# grab the key that LLVM use to GPG-sign binary distributions
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-6.0 main"
sudo apt-get install -y clang-6.0 lld-6.0

This gives you binaries with the following names (and more, probably):

clang-6.0
clang++-6.0
lld-6.0
ld.lld-6.0

It also installs these packages (and more):

llvm-6.0
llvm-6.0-dev
llvm-6.0-runtime

17.04 (Artful)

Same as above. I'll repeat every line for convenient copy-paste.

# grab the key that LLVM use to GPG-sign binary distributions
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-add-repository "deb http://apt.llvm.org/artful/ llvm-toolchain-artful-6.0 main"
sudo apt-get install -y clang-6.0 lld-6.0

16.04 (Xenial)

The accepted answer already gives instructions for installing clang-3.8 on 16.04, but here's how to get clang-6.0:

# grab the key that LLVM use to GPG-sign binary distributions
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main"
sudo apt-get install -y clang-6.0 lld-6.0
๐ŸŒ
TecAdmin
tecadmin.net โ€บ how-to-install-clang-on-ubuntu
How to Install Clang on Ubuntu 22.04 & 20.04 โ€“ TecAdmin
April 26, 2025 - If you need a specific version of Clang, you can search for available versions using: ... Replace <version> with the desired version number, for example, sudo apt install clang-15 for Clang version 15.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ how-to-install-clang-on-ubuntu-linux
How to Install Clang on Ubuntu Linux? - GeeksforGeeks
September 20, 2024 - Learn how to install Clang on Ubuntu Linux with step-by-step instructions, methods and FAQs.
๐ŸŒ
LinuxShout
linux.how2shout.com โ€บ home โ€บ how to install clang on ubuntu linux
How to Install Clang on Ubuntu Linux - LinuxShout - H2S Media
July 31, 2023 - What do we need?Using the APT Package Manager:Install Clang on Ubuntu linuxCheck VersionUse LLVM repository script for ClangSet Clang Version as the default compilerExample: Create the C programCompile the C program using ClangRun the compiled ...
๐ŸŒ
ArchWiki
wiki.archlinux.org โ€บ title โ€บ Clang
Clang - ArchWiki
November 27, 2025 - Clang is a C/C++/Objective C/CUDA compiler based on LLVM. The most recent iteration is distributed under the "Apache 2.0 License with LLVM exceptions". Install the clang package.
๐ŸŒ
bodHOST
bodhost.com โ€บ general discussion โ€บ how to install clang on ubuntu 20.04 and 22.04
How to Install Clang on Ubuntu 20.04 and 22.04
February 26, 2026 - Once updated, proceed with installing Clang by executing- sudo apt install clang This command installs Clang along with necessary dependencies.
Top answer
1 of 2
23

I found the solution after some searching. Here is what I did to make it work:

  1. Add the following lines to your /etc/apt/sources.list:
Copydeb http://apt.llvm.org/buster/ llvm-toolchain-buster main 
deb-src http://apt.llvm.org/buster/ llvm-toolchain-buster main 
deb http://apt.llvm.org/buster/ llvm-toolchain-buster-10 main 
deb-src http://apt.llvm.org/buster/ llvm-toolchain-buster-10 main 
deb http://apt.llvm.org/buster/ llvm-toolchain-buster-11 main 
deb-src http://apt.llvm.org/buster/ llvm-toolchain-buster-11 main
  1. Add signatures for these repos (otherwise apt-get update will complain in the next step)
Copywget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
  1. Run apt-get update to add these new repos to the apt-get:
Copysudo apt-get update
  1. Install clang-11:
Copysudo apt-get install clang-11
  1. Make sure now "clang-11" is used by the compiler and not the older "clang":
Copyexport CMAKE_C_COMPILER=clang-11
export CMAKE_CXX_COMPILER=clang++-11
  1. Compile your project.
  2. Enjoy!

For documentation: https://apt.llvm.org/

2 of 2
2

I would suggest installing the latest stable 15

  1. Add the following lines to your /etc/apt/sources.list:
Copydeb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye main
deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye main
# 15
deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-15 main
deb-src http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-15 main
  1. Add signatures for these repos (otherwise apt-get update will complain in the next step)
Copywget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
  1. Run apt-get update to add these new repos to the apt-get:
Copy sudo apt update && sudo apt upgrade
  1. To install all key packages
Copysudo apt-get install libllvm-15-ocaml-dev libllvm15 llvm-15 llvm-15-dev llvm-15-doc llvm-15-examples llvm-15-runtime
  1. Install clang-15
Copy sudo apt-get install clang-15 lldb-15 lld-15     
  1. Make sure now "clang-15" is used by the compiler and not the older "clang" and done just compile your project
Copyexport CMAKE_C_COMPILER=clang-15

export CMAKE_CXX_COMPILER=clang++-15

Doc https://apt.llvm.org/

๐ŸŒ
Red Hat
developers.redhat.com โ€บ blog โ€บ 2018 โ€บ 07 โ€บ 07 โ€บ yum-install-gcc7-clang
How to install Clang/LLVM 5 and GCC 7 on RHEL | Red Hat Developer
November 1, 2023 - To see which repos are available for your current subscription, run the following command: ... If you only want to install GCC 7, install just devtoolset-7. If you only want to install Clang/LLVM 5, install just llvmtoolset-7.
๐ŸŒ
Linux Mint Forums
forums.linuxmint.com โ€บ board index โ€บ interests โ€บ programming & development
Clang 15 - Linux Mint Forums
February 14, 2024 - Linux Mint 21.3 has clang 14 for easy installation through Synaptic Package Manager or with apt install clang. It will install required dependencies automatically. You probably will want to install build-essential apt install build-essential as well, which is a set of common packages for compiling.