AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1013519
Accepted
ellen
ellen
Asked: 2018-03-10 13:43:40 +0800 CST2018-03-10 13:43:40 +0800 CST 2018-03-10 13:43:40 +0800 CST

无法在 Ubuntu 14.04 上安装 cmake

  • 772

我在将 cmake 安装到我的机器上时遇到问题。这是我正在运行的内容:

sudo apt-get -f install cmake

这是输出:

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

我试过运行 apt-get update 但它似乎没有帮助。请让我知道我应该尝试什么。很乐意提供更多信息。

谢谢!:)

编辑:“apt-cache policy cmake”的输出如下:

    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

谢谢!

更新:谢谢!我能够安装cmake。但是,我似乎无法用它做任何事情。我在跑

cmake ../

在我正在尝试制作的项目中创建的一个空目录中。这是输出:

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.

有人知道下一步该怎么做吗?我试过卸载和重新安装以及apt-get更新。同样,如果需要,我可以在此处发布更多信息。

谢谢!

14.04 cmake
  • 3 3 个回答
  • 4875 Views

3 个回答

  • Voted
  1. Best Answer
    N0rbert
    2018-03-13T01:17:47+08:002018-03-13T01:17:47+08:00

    main您可以通过指定其版本从存储库安装 cmake :

    sudo apt-get install cmake=2.8.12.2-0ubuntu3
    

    如果失败,请尝试以下方法之一:

    • 从系统中删除 PPA 及其软件包,然后从main存储库安装版本

      sudo ppa-purge ppa:thomas-schiex/blender
      sudo ppa-purge ppa:george-edison55/cmake-3.x
      sudo apt-get install cmake
      
    • 暂时禁用 PPA,安装cmake然后启用 PPA:

      sudo add-apt-repository -r ppa:thomas-schiex/blender
      sudo add-apt-repository -r ppa:george-edison55/cmake-3.x
      sudo apt-get update
      sudo apt-get install cmake
      sudo add-apt-repository ppa:thomas-schiex/blender
      sudo add-apt-repository ppa:george-edison55/cmake-3.x
      

    然后你可以尝试构建简单的 cmake 示例。快速谷歌搜索给了我cmake-example.git存储库。我不知道这是什么,但它编译速度快并且运行正常:

    sudo apt-get install cmake git build-essential gfortran
    git clone https://github.com/bast/cmake-example.git
    cd cmake-example/
    mkdir build
    cd build
    cmake ..
    make
    

    您可以通过执行编译的程序来测试它:

    ./hello.x
    ./main.x
    ./unit_tests
    

    如果失败,那么您的系统中还有其他问题。

    • 0
  2. Gryu
    2020-03-18T10:44:29+08:002020-03-18T10:44:29+08:00

    从 Ubuntu 18.04 和 19.10 的源代码安装 Cmake 3.16.5:

    • 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

    cmake我的 Ubuntu 18.04 VM 上安装了两个版本:

    whereis cmake
    cmake: /usr/bin/cmake /usr/lib/x86_64-linux-gnu/cmake /usr/local/bin/cmake /usr/share/cmake /usr/share/man/man1/cmake.1.gz
    
    user@u1804:~$ /usr/local/bin/cmake --version
    cmake version 3.16.5
    
    user@u1804:~$ cmake --version
    cmake version 3.16.5
    
    user@u1804:~$ /usr/bin/cmake --version
    cmake version 3.10.2
    

    旧版本cmake已由sudo apt install cmake.

    但是当前最新的稳定版 cmake 3.16.5 也可以使用以下方式安装snap:

    sudo snap install cmake
    
    • 0
  3. RandyMartini
    2018-03-10T16:58:50+08:002018-03-10T16:58:50+08:00

    有一个14.04 版本的非官方存储库。

    sudo add-apt-repository ppa:mantid/mantid
    sudo apt-get update
    
    • -1

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve