最近在WSL中尝试了 Ubuntu 22.04 LTS,在解压文件中发现一个奇怪的BUG:
/usr/bin/gunzip: 57: exec: gzip: Exec format error
第一反应是重新安装 gzip,发现问题还在。试着删除 gzip,得到了下面的禁止删除提示:
The following packages will be REMOVED:
gzip
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
gzip
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 250 kB disk space will be freed.
E: Removing essential system-critical packages is not permitted. This might break the system.
瞬间傻眼了。度娘了很久还是没有解决问题。忽然灵光一闪,会不会是WSL版本过低与 Ubuntu 22.04 LTS不兼容?看一眼WSL版本是 1,升级到二代:
wsl --set-version Ubuntu-22.04 2
更新之后问题解决~