Skip to content

Instantly share code, notes, and snippets.

@SofijaErkin
Last active April 28, 2022 00:12
Show Gist options
  • Save SofijaErkin/f307c2c0220b8392633959e450646f1e to your computer and use it in GitHub Desktop.
Save SofijaErkin/f307c2c0220b8392633959e450646f1e to your computer and use it in GitHub Desktop.
Upgrade cmake over 3.14 on debian.

Debian Manually Upgrade CMake over 3.14

deps

build-essential, libtool, autoconf, unzip, wget

download from source and compile install

sudo wget -O cmake-3.14.6.tar.gz https://cmake.org/files/v3.14/cmake-3.14.6.tar.gz

tar zxvf cmake-3.14.6.tar.gz

cd cmake-3.14.6 && pwd && ls -a

cmake -DCMAKE_INSTALL_PREFIX=/usr .

But terminal output:

CMake Error at CMakeLists.txt:4 (cmake_minimum_required):

  CMake 3.1...3.12 or higher is required.  You are running version 3.0.2

-- Configuring incomplete, errors occurred!

So, to fix the upstairs, install cmake3.1 before install cmake3.14.

sudo wget -O cmake-3.1.0.tar.gz  https://cmake.org/files/v3.1/cmake-3.1.0.tar.gz

tar zxvf cmake-3.1.0.tar.gz

cd cmake-3.1.0 && pwd && ls -a

cmake -DCMAKE_INSTALL_PREFIX=/usr . 

make

make install

But terminal output:

-- Install configuration: ""

CMake Error at cmake_install.cmake:36 (file):

  file cannot create directory: /usr/doc/cmake-3.1.  Maybe need

  administrative privileges.

Makefile:66: recipe for target 'install' failed

make: *** [install] Error 1

to fix the upstairs:

sudo make install

Notice:

"make install" will replace the older version of Applications under

/usr/bin/, "make altinstall" will not replace the older version of the APP

with installing under /usr/local/bin.

If not use the older version of Applications, just use "make install";

If may be use the older version of Applications or do not to mix the new

and the older, just use "make altinstall".

Also, continue compile install CMake 3.14:

cmake -DCMAKE_INSTALL_PREFIX=/usr .

make

sudo make install

refer

Installing CMake.

How do I install the latest version of cmake from the command line?

CMake on Linux CentOS 7, how to force the system to use cmake3?

How to upgrade cmake in Ubuntu?

ソースコードからのビルドとインストール (Ubuntu Linux編)

[Linux][cmake] 最新のcmakeをインストールする方法

linux - 最新のcmakeバージョンを再インストールする方法は?

Install CMake 3.14.0 on Debian 10(Chinese).

Install other version CMake or upgrade CMake version on Linux(Chinese).

Upgrade CMake over 3.17(Chinese).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment