Kitware, the maintainers of CMake, provide an official repository for Ubuntu users. This is the best balance between ease of use and staying up-to-date.
If you don’t want to add a new repository, you can download the "ready-to-run" binaries directly from the CMake website. This is useful for environments without root access or for specific version pinning. cmake download ubuntu 18.04
Ubuntu 18.04 supports Snaps, which offer a "one-click" way to get the latest stable version of CMake. sudo snap install cmake --classic Use code with caution. Kitware, the maintainers of CMake, provide an official
sudo mv cmake-3.26.4-linux-x86_64 /opt/cmake sudo ln -s /opt/cmake/bin/* /usr/local/bin/ Use code with caution. Method 3: Installing via Snap the maintainers of CMake