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
Answer from maxschlepzig on Stack Exchange
🌐
Fnal
mu2ewiki.fnal.gov › wiki › CodeTools
CodeTools - Mu2eWiki
July 21, 2025 - # Debian, Ubuntu sudo apt-get install clang-format clang-tidy # MacOS (Homebrew) brew install clang-format # smaller package, just clang-format # or: # includes clang-format and clang-tidy - but takes up a lot more space brew install llvm ln -s "$(brew --prefix llvm)/bin/clang-format" ...
Discussions

c++ - How to install and use just Clang-Format on Fedora 27? - Stack Overflow
I'm trying to figure out how to install the stand alone Clang-Format tool. I've downloaded the pre build binaries for Clang from the official download page for my OS (Fedora 27). However I failed... More on stackoverflow.com
🌐 stackoverflow.com
how to properly install clang on Linux?
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). More on reddit.com
🌐 r/linuxquestions
5
2
November 13, 2022
software installation - How to install the latest stable Clang on Fedora? - Unix & Linux Stack Exchange
I'm considering switching to Fedora, but the latest stable Fedora (36) only ships Clang 14, while the latest release is Clang 15. Is there any way to get up-to-date binaries, without switching to the More on unix.stackexchange.com
🌐 unix.stackexchange.com
October 8, 2022
Installing clang-format for use in VS Code
Hello, I’ve been looking all over and it looks like it might be possible to install clang-format on Rocky per this post (Install clang-tools-extra-15 on Rocky 9) But I’ve not figured out how to install it. I found how to install it on Ubuntu, but that uses the apt-get command, so I tried ... More on forums.rockylinux.org
🌐 forums.rockylinux.org
2
0
December 17, 2024
🌐
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:
🌐
GitHub
github.com › robertu94 › clang-tidy-external-example
GitHub - robertu94/clang-tidy-external-example
... When this was written clang-tools-extra-devel was in the testing repo (should be in the primary repos soon and for Fedora 38), and may need to be installed with sudo dnf install --enablerepo=updates-testing --refresh --advisory=FEDORA-2...
Author   robertu94
🌐
Red Hat
bugzilla.redhat.com › show_bug.cgi
1328091 – [RFE] Package clang-query and clang-tidy
July 31, 2019 - Red Hat Bugzilla – Bug 1328091 · This site requires JavaScript to be enabled to function correctly, please enable it · Privacy Contact FAQ Legal
🌐
Clang
clang.llvm.org › extra › clang-tidy
Clang-Tidy — Extra Clang Tools 23.0.0git documentation
This script is included with clang-tidy and runs clang-tidy over all files in a compilation database or a specified path concurrently. The script requires a compilation database (compile_commands.json) which can be generated by build systems like CMake (using -DCMAKE_EXPORT_COMPILE_COMMANDS=ON) or by tools like Bear. The script supports most of the same options as clang-tidy itself, including -checks=, -fix, -header-filter=, and configuration options.
Find elsewhere
🌐
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.
🌐
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.
🌐
PyPI
pypi.org › project › clang-tidy
clang-tidy · PyPI
This project packages the clang-tidy utility as a Python package. It allows you to install clang-tidy directly from PyPI:
      » pip install clang-tidy
    
Published   Mar 30, 2026
Version   22.1.0.1
🌐
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?

🌐
LLVM
apt.llvm.org
LLVM Debian/Ubuntu packages
apt-get install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python3-clang install_stable
🌐
GitHub
github.com › rpm-software-management › dnf5 › blob › main › clang-tidy-changed
dnf5/clang-tidy-changed at main · rpm-software-management/dnf5
clang-tidy "$FILE" -checks="$CHECKS" -- -std=c++17 -I"$TOPDIR/include" | tee -a "$LOG" done
Author   rpm-software-management
🌐
FOSTips
fostips.com › blog › linux › how to install clang 16, 17 and/or 18 in debian 12
How to Install Clang 16, 17 and/or 18 in Debian 12 - FOSTips
September 28, 2023 - sudo apt install clang-17 lldb-17 lld-17 clangd-17 clang-tidy-17 clang-format-17 clang-tools-17 llvm-17-dev llvm-17-tools libomp-17-dev libc++-17-dev libc++abi-17-dev libclang-common-17-dev libclang-17-dev libclang-cpp17-dev libunwind-17-dev libclang-rt-17-dev libpolly-17-dev
🌐
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
sudo apt install clang-tidy-20 clang-format-20 clang-tools-20 llvm-20-dev lld-20 lldb-20 llvm-20-tools libomp-20-dev libc++-20-dev libc++abi-20-dev libclang-common-20-dev libclang-20-dev libclang-cpp20-dev liblldb-20-dev libunwind-20-dev
🌐
Read the Docs
dnf5.readthedocs.io › en › stable › best_practices › index.html
Best practices — dnf5 documentation
Run clang-format and clang-tidy to check coding style before submitting a pull request · If clang-format produces sub-optimal output, consider using // clang-format off|on where appropriate · Use templates and lambdas only if really necessary · Avoid shared_ptr because it isn’t supported in all SWIG bindings ·
🌐
Lindevs
lindevs.com › install-clang-tidy-on-ubuntu
Install Clang-Tidy on Ubuntu 24.04 | Lindevs
June 28, 2025 - Clang-Tidy requires access to standard headers such as stddef.h, which are provided by the compiler itself - either GCC or Clang. To ensure proper analysis, make sure you have a compiler like GCC or Clang installed, as they include these internal headers needed for parsing.