I'm having issues getting cmake installed onto my machine. Here is what I am running:
sudo apt-get -f install cmake
And here is the output:
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:
The following packages have unmet dependencies:
cmake : Depends: libjsoncpp1 but it is not installable
I have tried running apt-get update but it doesn't seem to help. Please let me know what I should try. Would be happy to provide more information.
Thanks! :)
Edit: The output of "apt-cache policy cmake" is as follows:
cmake:
Installed: (none)
Candidate: 3.5.2-2ubuntu1~ubuntu16.04.1~ppa1
Version table:
3.5.2-2ubuntu1~ubuntu16.04.1~ppa1 0
500 http://ppa.launchpad.net/thomas-schiex/blender/ubuntu/ trusty/main amd64 Packages
3.2.2-2~ubuntu14.04.1~ppa1 0
500 http://ppa.launchpad.net/george-edison55/cmake-3.x/ubuntu/ trusty/main amd64 Packages
2.8.12.2-0ubuntu3 0
500 http://ca.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
100 /var/lib/dpkg/status
Thanks!
Update: Thanks! I was able to install cmake. However, I can't seem to make anything with it. I'm running
cmake ../
in an empty directory which I created inside the project I'm trying to make. Here is the output:
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/bin
CMake Error: Error executing cmake::LoadCache(). Aborting.
Would anybody have any idea on what to do next? I have tried uninstalling and reinstalling as well as apt-get update. Again, I can post more information on here if needed.
Thanks!
You can install cmake from
main
repository by specifying its version:If it fails, try one of the following methods:
remove PPAs from system with their packages and then install version from
main
repositorytemporary disable PPAs, install
cmake
then enable PPAs:Then you can try to build simple cmake example. Fast googling gave me the cmake-example.git repository. I do not know what is this, but it compiles fast and runs normally:
You can test it by executing compiled programs:
If it fails then you have other problems in your system.
Cmake 3.16.5 installation from sources for Ubuntu 18.04 and 19.10:
wget https://github.com/Kitware/CMake/releases/download/v3.16.5/cmake-3.16.5.tar.gz
tar vxzv cmake-3.16.5.tar.gz
cd cmake-3.16.5
./bootstrap
make
sudo make install
I have two
cmake
versions installed on my Ubuntu 18.04 VM:Older version of
cmake
have been installed bysudo apt install cmake
.But current the latest stable release of cmake 3.16.5 could also be installed using
snap
:There is an unofficial repository that has a version for 14.04.