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 OverflowHow to downgrade clang on fedora linux.
Installing clang-format for use in VS Code
ubuntu - clang-tidy install - Unix & Linux Stack Exchange
Install clang-tools-extra-15 on Rocky 9
I'm new to clang. I am a GCC guy. I use Fedora. How should I install the latest version of clang and its dependencies on my system? What command should I run? Which packages should be installed in order to be able to build a basic C++ program which also has static linkage? Just run sudo dnf install clang? Anything else?
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?
You can use your package manager to find out which package clang-tidy provides. For example on Fedora/CentOS:
dnf whatprovides '*/clang*tidy*'
On Debian/Ubuntu you can use an analogous apt-file search command.
However, on Fedora 23 clang-tidy just isn't packaged. No match is found.
There is even an open bug report: Missing clang-query and clang-tidy
For Ubuntu/Debian, the LLVM project maintains an llvm apt repostiory. This should be the easiest way to get the latest clang-tidy. After configuring that repository and doing an apt-file update and apt-file search should return the package that provides clang-tidy.
An alternative to building from source is to use the upstream llvm pre-built binaries - they are available for Fedora, CentOS etc. For example the one for Fedora 23 does contain clang-tidy:
clang+llvm-3.8.0-x86_64-fedora23/bin/clang-tidy
Fedora 29 includes clang-tidy in the main Fedora repository. You can install it via:
dnf install clang-tools-extra