Ubuntu18.04 upgrade cmake tutorial

The tutorial for upgrading CMake on Ubuntu 18.04 is as follows:

  1. Update package index:

    • Open a terminal and execute the following command to update the package index:

      sudo apt update
  2. Remove old version of CMake:

    • Run the following command in a terminal to uninstall older versions of CMake:

      sudo apt remove cmake
  3. Download the latest version of CMake:

    • Find the latest version of CMake on the official CMake website ( Download | CMake ) and choose the Linux binary distribution suitable for your system.
    • Copy the download link.
  4. Download and install the latest version of CMake:

    • Run the following command in Terminal, replacing the download link with the actual link:

      wget <下载链接>
    • Unzip the downloaded file, for example:

      tar -zxvf cmake-<版本号>.tar.gz
    • Enter the decompressed directory:

      cd cmake-<版本号>
    • Run the following commands to configure and compile CMake:

      ./bootstrap
      make -j4  # 使用-j参数以加快编译速度,数字4表示同时使用4个核心
      sudo make install
  5. Verify installation:

    • Verify that the installation of CMake was successful by running the following command:

      cmake --version
    • If you can see the version information of CMake, it means the installation is successful.

Through the above steps, you can successfully upgrade to the latest version of CMake on Ubuntu 18.04. Please make sure that the downloaded CMake version matches your system architecture and requirements. Hope this information helps you!

Guess you like

Origin blog.csdn.net/tiansyun/article/details/132114845