: Run sudo apt update && sudo apt install cmake . Fedora, CentOS, & RHEL : Use sudo dnf install cmake . Arch Linux : Use sudo pacman -S --needed cmake . OpenSUSE : Run sudo zypper install cmake . Method 2: Download Official Pre-compiled Binaries
If your distribution's repository version is outdated, you can download pre-compiled binaries directly from the .
This is the simplest method for most users. It ensures compatibility and provides easy updates via your system’s standard update process. linux download cmake
: Look for the .sh binary for your architecture (e.g., cmake-x.y.z-linux-x86_64.sh ). Execute the installer :
CMake is a cross-platform, open-source build system essential for C and C++ development. On Linux, you can download and install it using several methods depending on whether you need the standard version or the absolute latest release. Method 1: Use a Native Package Manager : Run sudo apt update && sudo apt install cmake
Snap packages are maintained by Kitware (the creators of CMake) and often provide the most recent stable version regardless of your Linux distribution.
Method 3: Install via Snap (Recommended for Latest Versions) OpenSUSE : Run sudo zypper install cmake
chmod +x cmake-*.sh sudo ./cmake-*.sh --prefix=/usr/local --exclude-subdir Use code with caution.
Alternatively, you can download a .tar.gz archive, extract it, and manually add the bin directory to your system's PATH.