主要原因是不支持32位程序,可以用如下方法啓用:
WSL默認使用64bit的程序,不支持32位的程序,但我們仍然可以使用QEMU來虛擬化內核。
安裝QEMU
sudo apt update
sudo apt install qemu-user-static
sudo update-binfmts --install i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xf8\xff\xff\xff\xff\xff\xff\xff'
啓動服務,注意每次調試32位程序之前都要啓用一次
sudo service binfmt-support start
啓用32位架構
sudo dpkg --add-architecture i386
sudo apt update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386