3

I uninstalled cmake by the following commands:

sudo apt remove cmake
sudo apt purge --auto-remove cmake

and then installed the new version from cmake website. When I ran cmake --version I am getting the version that I have installed:

cmake version 3.11.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

However, when again I am trying to run this command, it seems it still has the previous version

$ sudo apt-get install cmake
Reading package lists... Done
Building dependency tree       
Reading state information... Done
cmake is already the newest version (3.5.1-1ubuntu3).
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.

I ran the following commands:

~$ which cmake
/usr/local/bin/cmake
~$ apt-cache policy cmake
cmake:
  Installed: 3.5.1-1ubuntu3
  Candidate: 3.5.1-1ubuntu3
  Version table:
 *** 3.5.1-1ubuntu3 500
        500 http://my.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     3.5.1-1ubuntu1 500
        500 http://my.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

Could you please guide me? I cannot install a software that needs higher version of cmake.

N0rbert
  • 99,918
S.EB
  • 189
  • Please add output of which cmake and apt-cache policy cmake to the question. – N0rbert Jun 11 '18 at 18:58
  • Installing a new version manually has nothing to do with apt : The "Package data base" has no information about manual installs, only knows about [packages.deb]. .... Your previous question 2 days ago about the same → https://askubuntu.com/questions/1045044/after-upgrading-the-cmake-i-am-still-getting-error-for-installing-the-itk#comment1704137_1045044 – Knud Larsen Jun 11 '18 at 21:02
  • @N0rbert I updated the question – S.EB Jun 12 '18 at 04:46
  • The tags say 12.04, 14.04, apt-cache's output indicates 16.04. Is this Schrodinger's Ubuntu? – muru Jun 12 '18 at 05:03
  • @muru sorry I am not expert and do not know what do you mean about Schrodinger's Ubuntu ? If you mean about ubuntu version, it is ubuntu 16.04 and I have installed from official website. – S.EB Jun 12 '18 at 05:18
  • @KnudLarsen Thanks for your comment, however, i could not resolve my issue. – S.EB Jun 12 '18 at 05:19
  • 1
    @S.EB : Please read my answer here https://askubuntu.com/questions/1045044/after-upgrading-the-cmake-i-am-still-getting-error-for-installing-the-itk#comment1704137_1045044 – Knud Larsen Jun 12 '18 at 07:34
  • 1
    cmake is located in /usr/local/bin/cmake and that is the problem. Remove it with sudo rm /usr/local/bin/cmake and try again. – N0rbert Jun 12 '18 at 11:11
  • @N0rbert Thanks for your patience and help – S.EB Jun 13 '18 at 07:57
  • @KnudLarsen Thank you very much for your help and patience – S.EB Jun 13 '18 at 07:58

1 Answers1

3

The output of which cmake says that your cmake is located in /usr/local/bin/cmake and that is the problem.

Remove it with sudo rm /usr/local/bin/cmake and try again.

N0rbert
  • 99,918
  • Why does it need to be removed? Shouldn't apt just update CMake? I also ran which cmake then ran sudo rm on the result, then sudo apt-get install cmake and got cmake is already the newest version (3.5.1-1ubuntu3). 0 upgraded, 0 newly installed, 0 to remove and 273 not upgraded. which I find very strange! This was fixed with sudo apt remove cmake sudo apt purge --auto-remove cmake but sudo apt-get install cmake still installed 3.5.1-1ubuntu3 which is certainly not the most recent version! – user1271772 Dec 28 '22 at 20:17