Score:1

Ubuntu Terminal on Windows 10: how to fix "kubectl: command not found"?

tn flag

I installed "Ubuntu Terminal on Windows 10" and tried to execute kubectl commands.

The problem is that I must add the .exe file extension to the command in order to operate it.

If I don't I get:

 kubectl: command not found

For example:

tal@shell130:~$ kubectl.exe version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.0", GitCommit:"cb303e613a121a29364f75cc67d3d580833a7479", GitTreeState:"clean", BuildDate:"2021-04-08T16:31:21Z", GoVersion:"go1.16.1", Compiler:"gc", Platform:"wind
ows/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.7", GitCommit:"65ecaf0671341311ce6aea0edab46ee69f65d59e", GitTreeState:"clean", BuildDate:"2019-01-24T19:22:45Z", GoVersion:"go1.10.7", Compiler:"gc", Platform:"linu
x/amd64"}
WARNING: version difference between client (1.21) and server (1.11) exceeds the supported minor version skew of +/-1

tal@shell130:~$ kubectl version
kubectl: command not found

On the other hand, on powershell, it works for me also without the file extension.

How can I fix this situation?

Thanks

preIdiot avatar
ph flag
can you edit your question and paste the command and its output together
dushkin avatar
tn flag
Updated question with an example. Thanks
preIdiot avatar
ph flag
I guess you have to install kubectl separately for the Ubuntu environment https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
dushkin avatar
tn flag
yes that worked! Thanks
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.