如何修复 add-apt-repository: command not found
问题
在 Ubuntu 或 Debian 上尝试添加 PPA 仓库时,你可能会遇到以下错误:
terminal-output.txt
$ sudo add-apt-repository ppa:some/ppa
sudo: add-apt-repository: command not found解决方案
add-apt-repository 命令属于 software-properties-common 软件包。要安装它,请运行以下命令:
install-software-properties.sh
sudo apt-get update
sudo apt-get install software-properties-common之后,你应该就能正常使用 add-apt-repository 命令了。
如果你看到如下错误信息
terminal-output.txt
E: Unable to locate package software-properties-common那么你可能正在使用 Debian Trixie。对于 Debian Trixie,我不知道使用 add-apt-repository 的直接方法。由于 PPA 是为 Ubuntu 设计的,你可以寻找替代的仓库,或者考虑升级到更新版本的 Debian,又或者如果确实需要 PPA 支持,则改用 Ubuntu。
按类别查看类似文章:
Linux
如果这篇文章对您有帮助,请考虑请我喝杯咖啡或通过 PayPal 捐款,以支持 TechOverflow 上新文章的研究与发布