Score:0

Kubeadm - Kubernetes: Failed to fetch https://packages.cloud.google.com/apt/dists/kubernetes-xenial/main/binary-arm64

jm flag

I am trying to deploy kubernetes (kubeadm cluster) on ARM64 based Ubuntu 20.04 virtual machine.

I am getting the follwoing error when deploying kubeadm:

xxx@controller01:~$ sudo mkdir -p /etc/apt/keyrings/
xxx@controller01:~$ curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-archive-keyring.gpg
xxx@controller01:~$ echo "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main
xxx@controller01:~$ sudo apt-get update
Hit:1 http://ae.ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:2 http://ae.ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Hit:3 http://ae.ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Hit:4 http://ae.ports.ubuntu.com/ubuntu-ports focal-security InRelease
Get:5 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [8993 B]
Ign:6 https://packages.cloud.google.com/apt kubernetes-xenial/main arm64 Packages
Ign:6 https://packages.cloud.google.com/apt kubernetes-xenial/main arm64 Packages
Ign:6 https://packages.cloud.google.com/apt kubernetes-xenial/main arm64 Packages
Err:6 https://packages.cloud.google.com/apt kubernetes-xenial/main arm64 Packages
  404  Not Found [IP: 142.250.181.110 443]
Fetched 8993 B in 6s (1622 B/s)
Reading package lists... Done
E: Failed to fetch https://packages.cloud.google.com/apt/dists/kubernetes-xenial/main/binary-arm64/by-hash/SHA256/51aebd1541ac7598ec1899940eeb94254bffdec2718eec413337389a0d58c794  404  Not Found [IP: 142.250.181.110 443]
E: Some index files failed to download. They have been ignored, or old ones used instead.

This error happens when I deploy kubernetes on ARM64 architecture CPU. Any help please?

[[UPDATE]]

I also tried suggestion of adding --dearmor or changing the

curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-archive-keyring.gpg

to

sudo curl -fsSLo /etc/apt/keyrings/kubernetes-archive-keyring.gpg https://dl.k8s.io/apt/doc/apt-key.gpg

But I got the similar issue:

xxx@controller01:~$ sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl
Hit:1 http://ae.ports.ubuntu.com/ubuntu-ports focal InRelease
Get:2 http://ae.ports.ubuntu.com/ubuntu-ports focal-updates InRelease [114 kB]
Get:3 http://ae.ports.ubuntu.com/ubuntu-ports focal-backports InRelease [108 kB]
Get:4 http://ae.ports.ubuntu.com/ubuntu-ports focal-security InRelease [114 kB]
Get:5 http://ae.ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 Packages [1924 kB]
Get:6 http://ae.ports.ubuntu.com/ubuntu-ports focal-updates/main Translation-en [440 kB]
Get:7 http://ae.ports.ubuntu.com/ubuntu-ports focal-updates/main arm64 c-n-f Metadata [16.5 kB]
Get:8 http://ae.ports.ubuntu.com/ubuntu-ports focal-updates/restricted Translation-en [273 kB]
Get:9 http://ae.ports.ubuntu.com/ubuntu-ports focal-updates/universe arm64 Packages [988 kB]
Get:10 http://ae.ports.ubuntu.com/ubuntu-ports focal-updates/universe Translation-en [254 kB]
Get:11 http://ae.ports.ubuntu.com/ubuntu-ports focal-updates/universe arm64 c-n-f Metadata [23.2 kB]
Get:12 http://ae.ports.ubuntu.com/ubuntu-ports focal-security/main arm64 Packages [1616 kB]
Get:13 http://ae.ports.ubuntu.com/ubuntu-ports focal-security/main Translation-en [358 kB]
Get:14 http://ae.ports.ubuntu.com/ubuntu-ports focal-security/main arm64 c-n-f Metadata [12.7 kB]
Get:15 http://ae.ports.ubuntu.com/ubuntu-ports focal-security/restricted Translation-en [256 kB]
Get:16 http://ae.ports.ubuntu.com/ubuntu-ports focal-security/universe arm64 Packages [759 kB]
Get:17 http://ae.ports.ubuntu.com/ubuntu-ports focal-security/universe Translation-en [173 kB]
Get:18 http://ae.ports.ubuntu.com/ubuntu-ports focal-security/universe arm64 c-n-f Metadata [16.4 kB]
Fetched 7446 kB in 4s (2078 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates is already the newest version (20230311ubuntu0.20.04.1).
ca-certificates set to manually installed.
curl is already the newest version (7.68.0-1ubuntu2.18).
curl set to manually installed.
The following NEW packages will be installed:
  apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 122 not upgraded.
Need to get 1704 B of archives.
After this operation, 162 kB of additional disk space will be used.
Get:1 http://ae.ports.ubuntu.com/ubuntu-ports focal-updates/universe arm64 apt-transport-https all 2.0.9 [1704 B]
Fetched 1704 B in 0s (6307 B/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 73286 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_2.0.9_all.deb ...
Unpacking apt-transport-https (2.0.9) ...
Setting up apt-transport-https (2.0.9) ...
xxx@controller01:~$ sudo mkdir -p /etc/apt/keyrings/
xxx@controller01:~$ sudo curl -fsSLo /etc/apt/keyrings/kubernetes-archive-keyring.gpg https://dl.k8s.io/apt/doc/apt-key.gpg
xxx@controller01:~$ sudo echo "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main
xxx@controller01:~$ sudo apt-get update
Hit:1 http://ae.ports.ubuntu.com/ubuntu-ports focal InRelease
Hit:2 http://ae.ports.ubuntu.com/ubuntu-ports focal-updates InRelease
Hit:4 http://ae.ports.ubuntu.com/ubuntu-ports focal-backports InRelease
Hit:5 http://ae.ports.ubuntu.com/ubuntu-ports focal-security InRelease
Get:3 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [8993 B]
Ign:6 https://packages.cloud.google.com/apt kubernetes-xenial/main arm64 Packages
Ign:6 https://packages.cloud.google.com/apt kubernetes-xenial/main arm64 Packages
Ign:6 https://packages.cloud.google.com/apt kubernetes-xenial/main arm64 Packages
Err:6 https://packages.cloud.google.com/apt kubernetes-xenial/main arm64 Packages
  404  Not Found [IP: 142.250.181.110 443]
Fetched 8993 B in 2s (4594 B/s)
Reading package lists... Done
E: Failed to fetch https://packages.cloud.google.com/apt/dists/kubernetes-xenial/main/binary-arm64/by-hash/SHA256/51aebd1541ac7598ec1899940eeb94254bffdec2718eec413337389a0d58c794  404  Not Found [IP: 142.250.181.110 443]
E: Some index files failed to download. They have been ignored, or old ones used instead.
Sai Chandini Routhu avatar
dk flag
@ Khaled Have you checked my answer
Score:0
dk flag

As per the Git link the issue occurs because https://packages.cloud.google.com/apt/doc/apt-key.gpg is returning the GPG key as ASCII armored instead of binary. If you do gpg --dearmor the key from packages.cloud.google.com apt is work again.

So,suggesting an alternate download source for the package signing key.

The reproducer would be running apt update in an existing installation without manually updating the key.

Note that the download location in the Kubernetes help pages changed and you might have to run sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg instead of updating the location of the key file.

Refer to this doc by KASATA to resolve this error. Some index files failed to download. They have been ignored, or old ones used instead.

Sai Chandini Routhu avatar
dk flag
@Khaled Let me know whether the shared info was helpful. I am happy to assist if you have any further queries. If the answer was helpful, Please consider to accept and upvote it.
Khaled avatar
jm flag
Hi Sai. Thanks for your comment and apologies for the late reply. I tested it but I got same issue. Can you check the update part in the question? I put the output error there. Thanks again for helping
Sai Chandini Routhu avatar
dk flag
Try to run this command sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
Sai Chandini Routhu avatar
dk flag
Refer to this [Gitlink](https://github.com/kubernetes/website/issues/41246) for more information about your issue
Sai Chandini Routhu avatar
dk flag
Refer to this [link 1](https://askubuntu.com/questions/329450), [link 2](https://askubuntu.com/questions/1286545),[link 3](https://packages.cloud.google.com/apt/dists/kubernetes-xenial/main/binary-arm64) for more information about your issue
Khaled avatar
jm flag
I tried: `$ sudo swapoff -a` --> `$ sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl` --> `$ sudo mkdir -p /etc/apt/keyrings/` --> `$ curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg packages.cloud.google.com/apt/doc/apt-key.gpg` --> `$ echo "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list` --> `$ sudo apt-get update` but I get same error: The repository 'InRelease' is not signed.
Sai Chandini Routhu avatar
dk flag
Refer to this [gitlink 1](https://github.com/kubernetes/release/issues/2862) and [gitlink 2](https://github.com/kubernetes/k8s.io/pull/4837#issuecomment-1446426585) may be helpful to resolve your issue
Sai Chandini Routhu avatar
dk flag
If there any possibility try to deploy kubernetes (kubeadm cluster) on ARM64 based Ubuntu 22.04 or 22.045 and also see this [gitlink](https://github.com/kubernetes/website/issues/25174)
Sai Chandini Routhu avatar
dk flag
@Khaled Let me know whether the shared info was helpful. I am happy to assist if you have any further queries. If the answer was helpful, Please consider to accept and upvote it
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.