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

Parrot Linux安装Heroku时add-apt-repository报错的解决方法咨询

解决Parrot Linux安装Heroku时的APT源识别错误

这个问题我之前帮朋友处理过,Parrot Linux虽说基于Debian,但用了自己独有的发行版标识,Heroku的APT源默认识别不了Parrot的版本,所以才会弹出Error: could not find a distribution template for Parrot/stable这个报错。给你几个靠谱的解决办法,亲测有效:

方法1:手动添加Heroku源并指定Debian兼容版本

这种方法绕开了add-apt-repository的版本识别问题,直接手动配置源:

  • 首先添加Heroku的GPG密钥,用来验证安装包的合法性:
    curl https://cli-assets.heroku.com/apt/release.key | gpg --dearmor | sudo tee /usr/share/keyrings/heroku-archive-keyring.gpg > /dev/null
    
  • 然后手动创建Heroku的源文件,指定使用Debian的stable版本(Parrot和Debian stable兼容性很好):
    echo "deb [signed-by=/usr/share/keyrings/heroku-archive-keyring.gpg] https://cli-assets.heroku.com/apt ./ stable main" | sudo tee /etc/apt/sources.list.d/heroku.list
    
  • 最后更新APT缓存并安装Heroku:
    sudo apt update && sudo apt install heroku
    

方法2:用官方curl脚本一键安装(最省心)

Heroku官方提供了针对Ubuntu的安装脚本,Parrot作为Debian系发行版完全兼容,直接运行就能避开源的问题:

curl https://cli-assets.heroku.com/install-ubuntu.sh | sh

脚本会自动处理依赖、配置路径,安装完成后直接就能用。

方法3:强制指定Debian发行版参数(适配add-apt-repository)

如果你坚持想用add-apt-repository命令,可以临时指定对应Debian的发行版代号(需要匹配你的Parrot版本):

  • Parrot 5.x系列对应Debian 11(代号bullseye),执行:
    sudo add-apt-repository "deb [arch=amd64] https://cli-assets.heroku.com/apt ./ bullseye main"
    
  • Parrot 6.x系列对应Debian 12(代号bookworm),执行:
    sudo add-apt-repository "deb [arch=amd64] https://cli-assets.heroku.com/apt ./ bookworm main"
    
  • 之后同样更新缓存并安装:
    sudo apt update && sudo apt install heroku
    

验证安装完成

不管用哪种方法,安装结束后都可以运行下面的命令确认是否成功:

heroku --version

内容的提问来源于stack exchange,提问作者Andrey Bushman

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 08:59:04