Install CMake on Fedora Linux 35

CMake is a free, open-source, and cross-platform compiler designed to build native environments, generate wrappers, build executables in arbitrary combinations. CMake is popular due to its cross-platform so that developers using the build system work the way they’re used to.

In the following tutorial, you will learn how to install CMake on Fedora Linux 35 Workstation or Server.


  • Recommended OS: Fedora Linux 35 Workstation or Server.
  • User account: A user account with sudo or root access.
  • Internet Access

The tutorial will utilize the terminal, which can be found in your show applications menu.


Install/Enable & Connect to SSH on Fedora Linux 35

Update Operating System

Update your Fedora operating system to make sure all existing packages are up to date:

sudo dnf upgrade --refresh -y

The tutorial will be using the sudo command and assuming you have sudo status.

To verify sudo status on your account:

sudo whoami

Example output showing sudo status:

[joshua@fedora ~]$ sudo whoami

To set up an existing or new sudo account, visit our tutorial on Adding a User to Sudoers on Fedora.

Option 1 – Install CMake with DNF

The first method recommended for most users will install CMake from Fedora’s repository. This is usually always up to date with the latest version, so unless you need a specific reason to compile CMake, use this installation method.

To begin the installation, use the following command.

sudo dnf install cmake

Example output:

Install CMake on Fedora Linux 35

Type Y, then press the ENTER KEY to proceed.

Once installed, confirm the installation by checking the version of CMake.

cmake --version

Example output:

cmake version 3.22.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Option 2 – Install CMake by Compiling Source

The second option for users requiring the latest version of CMake is downloading the source and compiling it. This is an excellent method as it allows you to install the newest version, but it comes at the cost of remembering to download and re-compile for updates.

Before proceeding further, install the following required dependencies on your system using the following command.

sudo dnf install gcc gcc-c++ openssl-devel bzip2-devel libffi-devel zlib-devel make -y

First, visit the Github releases page and grab the latest version link.

Do not forget to do this as the examples link below will be outdated in time.

Next, download the archive using the wget command.

Example only:

wget https://github.com/Kitware/CMake/releases/download/v3.22.2/cmake-3.22.2.tar.gz

Extract the archive contents using the following command.

tar -zxvf cmake-{version number}.tar.gz

Now CD into the directory that was extracted.

cd cmake-{version number}

In the next part, you will Bootstrap script. If you encounter any issues, make sure the dependencies mentioned further up are installed.


The Bootstrap script may take a few minutes. Once done, use the make command to build the package.


Next, install CMake using the following make install command.

make install

This process can take a few minutes to almost ten minutes to make a coffee or grab a drink.

Once the installation has finished, check the CMake version.

cmake version 3.22.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

As above, you have successfully installed version 3.22.2 by compiling method, but given Fedora focuses on the latest releases, it is the same version at the current time of this tutorial.

Comments and Conclusion

In the tutorial, you have learned two ways to install CMake on your Fedora 35 Workstation or Server, along with the dependencies required.

Overall, if you are looking into development and programming or running a server with services, you will often come across this package.

For further reading, visit CMake’s official documentation.

Follow LinuxCapable.com!

Like to get automatic updates? Follow us on one of our social media accounts!