"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
• 6,880 points
2,128 views

5 answers to this question.

+2 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 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
• 40,420 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 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 by Anand
+1 vote
Docker only works on 64-bit platform so it's necessary you install Kubernetes on 64 Bits.
answered May 6 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
1 answer

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

Make sure you've followed these steps accurarely, ...READ MORE

answered Dec 18, 2018 in Kubernetes by Charlie
555 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
• 40,420 points
298 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,810 points
235 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
54 views
+1 vote
1 answer
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17 in Others by anonymous
2,050 views
+3 votes
1 answer