Cloud Technology

Why am I getting an "Unable to locate package" error when installing kubeadm, kubelet, and kubectl?

RI Asked by Richard Henderson · 14-11-2025
0 upvotes 8,435 views 0 comments
The question

I am trying to set up a Kubernetes cluster on a fresh Ubuntu 22.04 LTS instance, but every time I run the sudo apt-get install command for kubelet, kubeadm, and kubectl, I get the "unable to locate package" error. I have already run the update command, yet the terminal still can't find these tools in the default repositories. Am I missing a specific repository source or a GPG key configuration that is required for the official Kubernetes packages? This is stalling my entire CI/CD pipeline setup.

3 answers

0
PA
Answered on 16-11-2025

The issue occurs because Kubernetes packages are not hosted in the default Ubuntu/Debian repositories. To fix this, you must manually add the Kubernetes APT repository. In early 2024, the repository location changed from Google-hosted to the community-owned pkgs.k8s.io. You need to download the GPG key, save it to /etc/apt/keyrings/, and then add the repository to your sources list. If you are following an old tutorial that points to apt.kubernetes.io, it will fail because that legacy repository was deprecated. Always ensure you are using the latest community repository URL and run sudo apt update before attempting the installation again.

0
CH
Answered on 18-11-2025

Are you following the updated documentation for the new community-led package repositories at pkgs.k8s.io, or are you still using the old Google Cloud (https://www.google.com/search?q=packages.cloud.google.com) instructions?

MI 20-11-2025

That is exactly the problem most people face right now, Christopher. Since the legacy Google-hosted repositories were frozen, anyone trying to install the latest versions of Kubernetes will get a "not found" error or end up with ancient versions if they don't switch to the new community-owned infrastructure. You must make sure your /etc/apt/sources.list.d/kubernetes.list file points to the specific Kubernetes minor version you want, like v1.30, because the new repo structure is version-specific rather than a single "catch-all" bucket.

0
BA
Answered on 22-11-2025

You need to add the keyring and the new repo. The command would look like echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /".

RI 23-11-2025

I agree with Barbara. Without the signed-by flag pointing to the keyring, apt will reject the repository for security reasons, leading to the same "unable to locate" error you are seeing.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

Book Free Session