-bash: /usr/local/bin/kops: cannot execute binary file

3.1k Views Asked by At

Any help or hint would greatly appreciated. I am using Windows 11 Professional.

I am connect to AWS and when I type the command "kops" I get the below error message.

[ec2-user@ip-172-31-10-126 ~]$ curl -Lo kops https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-darwin-amd64

% Total % Received % Xferd Average Speed Time Time Time Current

                             Dload  Upload   Total   Spent    Left  Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

100 157M 100 157M 0 0 98.8M 0 0:00:01 0:00:01 --:--:-- 119M

[ec2-user@ip-172-31-10-126 ~]$ chmod +x kops

[ec2-user@ip-172-31-10-126 ~]$ sudo mv kops /usr/local/bin/kops

[ec2-user@ip-172-31-10-126 ~]$ kops

-bash: /usr/local/bin/kops: cannot execute binary file

enter image description here

1

There are 1 best solutions below

0
stdunbar On

You're only using Windows 11 as a ssh client - it's not doing anything for Kubernetes.

As @jordanm indicates you're trying to download the MacOS version. Change your command to:

curl -Lo kops https://github.com/kubernetes/kops/releases/download/$(curl -s https://api.github.com/repos/kubernetes/kops/releases/latest | grep tag_name | cut -d '"' -f 4)/kops-linux-amd64

to get the Linux version