Unable to locate package error while installing kubelet kubeadm kubectl

+1 vote

I'm trying to create a kubernetes cluster, and when i run the following command, i get an error

root@ip-172-31-36-181:~# apt-get install -y kubelet kubeadm kubectl
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package kubelet
E: Unable to locate package kubeadm
E: Unable to locate package kubectl
Sep 19, 2018 in Kubernetes by Nilesh
• 7,060 points
22,421 views

5 answers to this question.

+3 votes
Best answer

Work around 1 :  log in as root user sudo su –

-curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - apt-get update

Apt-get install –y

Workaround 2:

Edit /etc/apt/sources.list.d/kubernetes.list or /etc/apt/sources.list ( depends on ubuntu version)

add 

deb http://apt.kubernetes.io/ kubernetes-xenial main   at the end of the list of repositories 
then run below commands, it works!..
apt-get update
apt-get install -y kubelet kubeadm kubectl
answered Oct 25, 2018 by Lakshmi Narayana ( L N )

selected May 6, 2019 by Kalgi
I had the same error and this solved it, thanks a lot @Lakshmi Narayana... but I still don't understand, why I ended up with this error in the first place?

I tried both the options but still unable to install Kubelet Kubeadm and Kubectl. It is throwing me the same error

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package kubelet
E: Unable to locate package kubeadm
E: Unable to locate package kubectl

Mine is Mac system, installed Oracle virtual box and installed Ubuntu as guest OS to configure Kubernetes cluster.

Ubuntu 16.04 - i686

Pls help..

hey @Keshava, did you add key for your repository?
0 votes
Execute the following commands one by one:

1) apt-get update && apt-get install -y apt-transport-https curl

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

3) # cat <<EOF >/etc/apt/sources.list.d/kubernetes.list

deb http://apt.kubernetes.io/ kubernetes-xenial main

EOF

4) # apt-get update
answered Sep 19, 2018 by Kalgi
• 52,350 points
+1 vote

Most people get this error because they miss out on adding a key for the repo.

Add key for new repository using the following command:

curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
answered May 6, 2019 by Kylie
+1 vote

For 16.04 add a repository using the following commands and you should be good to go :)

sudo vim /etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
answered May 6, 2019 by Anand

It is the goolgle's direct comand in the Docker.  

1. Delete all the installed google cloud and Kubernetes components

$ sudo rm -rf /usr/share/keyrings/cloud.google.gpg

$ sudo rm -rf /usr/share/keyrings/cloud.google.gpg~ 

$ sudo rm -rf /etc/apt/sources.list.d/google-cloud-sdk.list

$ sudo rm -rf /etc/apt/sources.list.d/kubernetes.list

2. change to the super user interface

$ sudo su 

3. Execute the Google command with the super user authority

# echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg  add - && apt-get update -y && apt-get install google-cloud-sdk -y

Reference:

google cloud sdk: https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu

+1 vote
Docker only works on 64-bit platform so it's necessary you install Kubernetes on 64 Bits.
answered May 6, 2019 by Nadia
Mine was a 32 bit machine. Tried installing on 64 bit. Got installed without any issue. Thanks

Related Questions In Kubernetes

0 votes
2 answers

" apt-get install -y kubelet kubeadm kubectl" giving error

apt-get install -y kubelet kubeadm kubectl kubernetes-cni READ MORE

answered Sep 11, 2020 in Kubernetes by anonymous
10,697 views
0 votes
2 answers

Error while installing MiniKube

Check if it's properly enabled for the ...READ MORE

answered Aug 30, 2018 in Kubernetes by Kalgi
• 52,350 points
1,534 views
0 votes
1 answer

Unable to get cgroup stats for docker and kubelet services

Try and start kubelet with the following ...READ MORE

answered Sep 3, 2018 in Kubernetes by DareDev
• 6,890 points
5,110 views
0 votes
2 answers

Error while installing curl on ubuntu

This might help https://www.edureka.co/community/18638/resource-tempo ...READ MORE

answered Nov 23, 2018 in Kubernetes by Harsha
1,497 views
+1 vote
1 answer
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
15,488 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,041 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP