几周前,我尝试通过 shell 在我的 Ubuntu 机器上安装 GitHub CLI,现在每次尝试更新时都会收到以下错误:
E: The repository 'https://cli.github.com/packages kinetic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
我无法打开任何 GUI,因为我严格从 shell 使用这台机器。目前在 Ubuntu 22.10 上,有人可以帮忙吗?
答案1
您的 APT 源是错误的,它应该包含stable
,而不是kinetic
。
删除 中的违规源/etc/apt/sources.list
,或者如果它在 中自己的文件中定义/etc/apt/sources.list.d/
,请将其删除。
使用grep
来查找它:
grep -r kinetic /etc/apt/sources.list*
就是这样。
如果您仍想(重新)安装 GitHub CLI,请按照Debian、Ubuntu Linux、Raspberry Pi OS(apt)安装步骤:
type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
打字太多?我将步骤添加到帕斯特宾使您更轻松地下载和执行代码片段。运行之前请务必检查其内容!
curl -s https://pastebin.com/raw/ejJNbaE8 | tr -d '\r' | sh