[Docker M1/M2 Mac] qemu-x86_64: Could not open /lib64/ld-linux-x86-64.so.2: No such file or directory AWS CLI


% aws --version

qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': 
No such file or directory

If you have installed AWS CLI on the Ubuntu docker image on your M1/M2 Mac and are trying to run the aws commands and you get the above error, then the reason could be that the underlying Ubuntu image will be an ARM one and not x86-64 one.

Solution 1:

Download the AWS CLI2 for ARM Linux and get it installed.

Download awscli (AWS LINK: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
$ curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
Solution 2:

While running your docker image for Ubuntu set the --platform option as linux/x86_64

|CBS|BASH|% docker run --platform linux/x86_64 ubuntu
Fix - Docker Ubuntu Could not open linux-x86-64-so.2
Fix - Docker Ubuntu Could not open linux-x86-64-so.2
Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap