You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

BeagleBone Black安装cmake报错“Package 'cmake' has no installation candidate”求助

在BeagleBone Black(Debian Buster IoT 2020-04-06)上安装cmake的解决方法

方法一:更新软件源并尝试官方包安装

出现E: Package 'cmake' has no installation candidate的原因大概率是软件源未更新,或者当前源未包含cmake包。执行以下步骤:

  • 首先更新软件源列表:
    sudo apt update
    
  • 再次尝试安装cmake:
    sudo apt-get install cmake
    

如果仍然失败,说明当前源的组件不全,需要编辑源文件添加缺失的组件:

  • 打开源配置文件:
    sudo nano /etc/apt/sources.list
    
  • 将文件中所有类似deb http://deb.debian.org/debian buster main的行,补充contrib non-free,修改后如下:
    deb http://deb.debian.org/debian buster main contrib non-free
    deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
    deb http://deb.debian.org/debian buster-updates main contrib non-free
    
  • 保存退出(按Ctrl+O,回车,再Ctrl+X),然后重新更新源并安装:
    sudo apt update
    sudo apt-get install cmake
    

方法二:手动编译安装cmake(如果官方源无法获取)

如果上述方法无效,可以直接从源码编译安装:

  • 先安装编译所需依赖:
    sudo apt-get install build-essential libssl-dev
    
  • 下载cmake源码包(以3.18.6版本为例,适配Debian Buster):
    wget https://cmake.org/files/v3.18/cmake-3.18.6.tar.gz
    
  • 解压源码包:
    tar -zxvf cmake-3.18.6.tar.gz
    
  • 进入解压后的目录:
    cd cmake-3.18.6
    
  • 配置编译环境:
    ./bootstrap
    
  • 编译源码(-j4利用4核加速编译,BeagleBone Black支持4线程):
    make -j4
    
  • 安装编译好的cmake:
    sudo make install
    
  • 验证安装成功:
    cmake --version
    

关于make: *** No targets specified and no makefile found.的说明

这个错误是因为当前目录下没有Makefile文件,和cmake安装无关。等cmake安装完成后,你可以通过CMakeLists.txt生成对应的Makefile,再执行make命令即可。

内容的提问来源于stack exchange,提问作者Tạ Lục Gia Hoàng

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.02 03:33:12