kubectl version
/home/lenovo/.local/bin/kubectl: line 1: syntax error near unexpected token <' /home/lenovo/.local/bin/kubectl: line 1:
NoSuchKey
The specified key does not exist.No such object: kubernetes-release/release//bin/linux/amd64/kubectl'
Asked
Active
Viewed 3,453 times
1
-
That sounds like the `kubectl` you have isn't actually the Kubernetes client binary. Did you get it through a `curl` command or a similar download? Was that actually successful? – David Maze Sep 27 '22 at 11:52
-
What's your OS ? – Reda E. Sep 27 '22 at 12:01
-
my os is ubuntu – Noob Sep 27 '22 at 12:32
-
Did you tried other commands like get pods or describe something ? – Shaktirajsinh Jadeja Sep 27 '22 at 12:33
-
Now the problem is solved i re-install it... but now another problem come which is ----The connection to the server localhost:8080 was refused - did you specify the right host or port?--- after running kubectl get pod – Noob Sep 27 '22 at 17:51
1 Answers
2
I cleared kubectl from /usr/local/bin
and also from /home/$USER/.local/bin
And run the commands below:
curl -LO "https://dl.k8s.io/release/v1.24.7/bin/linux/amd64/kubectl"
curl -LO "https://dl.k8s.io/v1.24.7/bin/linux/amd64/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
sudo install -o root -g root -m 0755 kubectl /home/$USER/.local/bin/kubectl

Adrian David Smith
- 574
- 1
- 4
- 26

Luiz
- 21
- 2
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 25 '22 at 07:57