【问题标题】:Unable to add kubernetes-bionic main (Ubuntu 18.04) to apt repository无法将 kubernetes-bionic main (Ubuntu 18.04) 添加到 apt 存储库
【发布时间】:2018-10-30 16:00:00
【问题描述】:

我正在尝试在我的 Ubuntu 服务器/桌面版本 18.04.1 上安装 Kubernetes。 但是,当我想使用以下命令将 kubernetes 添加到 apt 存储库时:

sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-bionic main"

我收到以下错误:

Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease                                                                                               
Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                          
Hit:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease                                                                                       
Hit:5 http://dl.google.com/linux/chrome/deb stable Release                                                                                            
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease                                                                                     
Hit:7 https://download.docker.com/linux/ubuntu bionic InRelease                                                                                       
Ign:8 https://packages.cloud.google.com/apt kubernetes-bionic InRelease                              
Err:10 https://packages.cloud.google.com/apt kubernetes-bionic Release
  404  Not Found [IP: 216.58.211.110 443]
Reading package lists... Done
E: The repository 'http://apt.kubernetes.io kubernetes-bionic 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.

如果我尝试安装 kubeadm,它不起作用,因为我没有将存储库添加到 apt

我希望有人能对我的问题有所了解..

所有这些都在 Hyper-V 上的虚拟机中运行

PS:我不是死忠的 Linux 专家,而是来自 Windows!

【问题讨论】:

  • 你下载gpg并添加到apt-key了吗?
  • @Crou 是的,我有..
  • 目前我手动将kubernetes.list 添加到/ect/apt/sources.list.d/ 并添加了[allow-insecure=yes],这暂时解决了我的问题,但这不是我认为的首选方式。
  • @JordyvanEijk 错误消息是“kubernetes-bionic Release'没有发布文件。”这与验证错误无关。正如您在packages.cloud.google.com/apt/dists 看到的那样,没有仿生元数据文件,因此没有包

标签: kubernetes apt ubuntu-18.04


【解决方案1】:

目前(2018 年 11 月)没有仿生文件夹。您可以在此处查看支持的发行版:

https://packages.cloud.google.com/apt/dists

kubernetes 的最后一个版本是:kubernetes-yakkety

这应该仍然适用于仿生。

【讨论】:

  • 2021 年仍然没有。只有 kubernetes-xenial 为我在 Ubuntu 18.04 上工作。
【解决方案2】:

Bionic 文件夹还没有创建,但是我测试了添加带有 ' 的存储库 sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" 和 sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-yakkety main"

我可以在 Ubuntu 18.04 上安装 Kubeadm、Kubectl 和 kubelet,代号为 *bionic**...。

请确保按照建议添加 GPG 密钥并遵循良好做法,否则这会产生通过正确的包名称推送恶意代码的漏洞...

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add

您可以自己检查 dists 上的所有存储库 - https://packages.cloud.google.com/apt/dists/

您还可以验证存储库是否已添加到 /etc/apt/source.list 或 /etc/apt/source.list.d,如果存在则应该没问题....

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-13
    • 1970-01-01
    • 2021-08-20
    • 2012-09-23
    • 1970-01-01
    • 2011-06-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多