Install clang-tools extra:

sudo dnf install clang-tools-extra

For Fedora < 32, you just need to install clang, which already bundles the clang-format tool.

sudo dnf install clang

And if you want to find the location of clang-format.You can use locate.

locate clang-format
Answer from dao leno on Stack Overflow
Discussions

How to downgrade clang on fedora linux.
You could use a container running one of the EL8 rebuilds (CentOS Stream, AlmaLinux, etc.) using e.g. distrobox. More on reddit.com
🌐 r/Fedora
9
4
October 11, 2022
Installing clang-format for use in VS Code
I found how to install it on Ubuntu, but that uses the apt-get command, so I tried doing ‘sudo dnf install clang-format’ but got the following message: Last metadata expiration check: 0:23:46 ago on Tue 17 Dec 2024 08:57:42 AM MST. No match for argument: clang-format Error: Unable to find a... More on forums.rockylinux.org
🌐 forums.rockylinux.org
2
0
December 17, 2024
ubuntu - clang-tidy install - Unix & Linux Stack Exchange
I have clang installed from packages on both Ubuntu 14.07, Centos 7 and Fedoara 22. I would like to use clang-tidy but can neither find a package nor how to install it without installing clang from More on unix.stackexchange.com
🌐 unix.stackexchange.com
Install clang-tools-extra-15 on Rocky 9
How do I update clang-tools-extra? If I download the rpm and ‘sudo dnf install’ it turns into a host of dependencies not met. Is there a way to add a repo or follow a different recipe so dependencies are automatically installed similar to ‘apt install’? Thanks for helping a newb, Dave More on forums.rockylinux.org
🌐 forums.rockylinux.org
1
0
March 30, 2023
🌐
Fedora Developer Portal
developer.fedoraproject.org › tech › languages › c › cpp_installation.html
C++ — Fedora Developer Portal
Clang works both for C++ and C and the installation is the same as for C: $ sudo dnf install clang · The only difference when compiling is that you need to use the command clang++: $ clang++ -std=c++14 your_source.cpp -o your_binary · This will produce the same result as the command with ...
🌐
TecAdmin
tecadmin.net › installing-clang-on-centos
Step-by-Step Guide to Installing Clang on CentOS & Fedora – TecAdmin
April 26, 2025 - Fedora users can install Clang directly from the default repositories without additional configuration. Use the dnf package manager to install Clang by running:
🌐
Red Hat
bugzilla.redhat.com › show_bug.cgi
1427679 – dnf install clang does not also install llvm (which clang depends on)
Red Hat Bugzilla – Bug 1427679 · This site requires JavaScript to be enabled to function correctly, please enable it · Privacy Contact FAQ Legal
🌐
idroot
idroot.us › home › how to install clang on fedora 39
How To Install Clang on Fedora 39 - idroot
May 13, 2024 - To install clang-tools-extra, run the following command: ... Step 3. Troubleshooting. Despite best efforts, you may encounter issues during the installation process. Here are a few common problems and their solutions: If dnf cannot find the Clang package, ensure that your package repository is up-to-date by running sudo dnf update -y.
🌐
Installati.one
installati.one › home › fedora › 34th › how to install clang on fedora 34
How To Install clang on Fedora 34 | Installati.one
August 1, 2021 - Install compiler-rt if you want the Blocks C language extension or to enable sanitization and profiling options when building, and libomp-devel to enable -fopenmp. We can use yum or dnf to install clang on Fedora 34.
Find elsewhere
🌐
idroot
idroot.us › home › how to install clang on fedora 42
How To Install Clang on Fedora 42 - idroot
May 9, 2025 - Execute the following command to install Clang and its essential components: ... The package manager will calculate dependencies and prompt you to confirm the installation. Type ‘y’ and press Enter to proceed. Wait for the installation to complete. DNF will download and install Clang 20.1.3-1.fc42 along with necessary dependencies.
🌐
Reddit
reddit.com › r/fedora › how to downgrade clang on fedora linux.
r/Fedora on Reddit: How to downgrade clang on fedora linux.
October 11, 2022 -

I have started to use fedora, and I need to use clang, but however the one installed through the terminal in too updated. It's version 14 and i need version 12.

Ideally I want version: 'clang-12.0.1-1.fc34'.

I have tried 'sudo dnf downgrade clang'. but this only changes it down to the base 14 version and won't downgrade any further.

Apologies if this is the wrong sub reddit. Is there a way of downgrading clang?

🌐
Rocky Linux Forum
forums.rockylinux.org › rocky linux help & support
Installing clang-format for use in VS Code - Rocky Linux Help & Support - Rocky Linux Forum
December 17, 2024 - I found how to install it on Ubuntu, but that uses the apt-get command, so I tried doing ‘sudo dnf install clang-format’ but got the following message: Last metadata expiration check: 0:23:46 ago on Tue 17 Dec 2024 08:57:42 AM MST.
🌐
NASA
nasa.github.io › trick › documentation › install_guide › Install-Guide.html
Trick | Install-Guide.md - NASA
dnf install -y bison clang flex git llvm make maven swig cmake clang-devel \ gcc gcc-c++ java-11-openjdk-devel libxml2-devel llvm-devel llvm-static \ ncurses-devel openmotif openmotif-devel perl perl-Digest-MD5 udunits2 udunits2-devel \ which zlib-devel gtest-devel perl-Text-Balanced python-devel diffutils zip
🌐
Red Hat
docs.redhat.com › en › documentation › red_hat_developer_tools › 1 › html-single › using_llvm_13.0.1_toolset › index
Using LLVM 13.0.1 Toolset | Red Hat Developer Tools | 1 | Red Hat Documentation
# dnf install cmake-doc · You can find the documentation under the following path: /usr/share/doc/llvm/html/cmake.html. For more information on LLVM Toolset, see the official LLVM documentation. Clang is an LLVM compiler front end for the C-based languages C, C++, Objective C/C++, OpenCL, and Cuda.
🌐
Rocky Linux Forum
forums.rockylinux.org › rocky linux help & support
Install clang-tools-extra-15 on Rocky 9 - Rocky Linux Help & Support - Rocky Linux Forum
March 30, 2023 - I see Rocky 9 install clang-format-14 but there’s a feature on clang-format-15 I really want to use. How do I update clang-tools-extra? If I download the rpm and ‘sudo dnf install’ it turns into a host of dependencies not met.
🌐
Stack Overflow
stackoverflow.com › questions › 30773766 › do-i-need-to-install-all-header-files-and-libraries-myself-when-using-clang
c++ - Do I need to install all header files and libraries myself when using clang? - Stack Overflow
June 5, 2017 - I am a newbie of clang. using "dfn install clang" command to install clang: [root@Fedora include]# dnf install clang Last metadata expiration check performed 0:16:10 ago on Wed Jun 10 22:32:08 2015. Dependencies resolved.
🌐
Wiki Étudiants INGI
wiki.student.info.ucl.ac.be › Logiciels › CLang
Wiki étudiants INGI | Logiciels / CLang
Vérifiez l'installation avec la commande clang --version · Installation sous Fedora · Dans un terminal, tapez la commande sudo dnf update · Exécutez ensuite la commande sudo dnf install clang ·