安装时出现 Heroku 错误

安装时出现 Heroku 错误

我第一次尝试将 Heroku 下载到我的 Ubuntu 16.04 上,并严格按照 Heroku 网站的说明进行操作:

sudo add-apt-repository "deb https://cli-assets.heroku.com/branches/stable/apt ./"
curl -L https://cli-assets.heroku.com/apt/release.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install heroku

但是每次我执行 sudo apt-get update 时都会收到以下错误:

W: the repository 'http:''cli-assets.heroku.com/branches/stable/apt ./ Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. 
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://cli-assets.heroku.com/branches/stable/apt/./Packages
403 Forbidden [IP: 52.84.3.182 80]
E: Some index files failed to download. They have been ignore, or old ones used instead.
W: Duplicate sources.list entry https://cli-assets.heroku.com/branches/stable/apt ./Release

有什么建议吗?

答案1

我刚刚在 Ubuntu 16.10 上尝试过并且它可以工作。

尝试逐行运行命令,而不是复制并粘贴整个内容。确保开头和结尾没有添加奇怪的字符(如 $ 和 ~),以便短语与您看到的完全相同。有时从网络复制和粘贴时会添加额外的字符。要在命令行上粘贴,请使用Ctrl+ Shift+ v

你收到任何回复了吗?

运行第一行后,运行cat /etc/apt/sources.list | grep heroku以查看新的 heroku 存储库是否存在。如果没有,则第一行不起作用。您应该看到类似以下内容:

deb https://cli-assets.heroku.com/branches/stable/apt ./

# deb-src https://cli-assets.heroku.com/branches/stable/apt ./

第二行应该添加密钥进行身份验证,因此您不应该收到无法验证数据的错误。要在运行后验证它是否已添加,请键入sudo apt-key list | grep heroku。您应该得到如下内容:

uid [ unknown] Heroku Release Engineering <[email protected]>

然后进行更新并安装,就可以了:)

相关内容