Wednesday 13 April 2022

How to install the latest cmake version?

reference: https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line

Kitware now has an APT repository that currently supports Ubuntu 16.04, 18.04 and 20.04

Install Instructions:

  1. Remove old version of cmake

    sudo apt purge --auto-remove cmake
    
  2. Obtain a copy of the signing key

    wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
    
  3. Add the repository to your sources list

    a. For Ubuntu Focal Fossa (20.04)

    sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main'     
    

    b. For Ubuntu Bionic Beaver (18.04)

    sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
    

    c. For Ubuntu Xenial Xerus (16.04)

    sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
    
  4. Update and install

    sudo apt update
    sudo apt install cmake
    

 

No comments:

Post a Comment