WSL sudo apt 尝试使用 Windows 文件路径

WSL sudo apt 尝试使用 Windows 文件路径

我使用 Ubuntu 20.04.4 LTS (Focal Fossa) 安装了几天前的 WSL。我正在尝试修复我遇到的一些包问题(特别是 gradle),但我没有发现它sudo apt --fix-broken install正在破坏,因为我相信它正在尝试使用与 unix 文件路径混合的 Windows 文件路径?

我认为导致此问题的错误是python3: can't open file 'C:\\usr\\bin\\py3clean': [Errno 2] No such file or directoryC:使用反斜杠相结合使我认为导航存在问题,但路径/usr/bin/py3clean是合法的现有路径。

$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  libsasl2-modules
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  python3-apport
The following packages will be upgraded:
  python3-apport
1 upgraded, 0 newly installed, 0 to remove and 156 not upgraded.
5 not fully installed or removed.
Need to get 0 B/249 kB of archives.
After this operation, 12.3 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 31852 files and directories currently installed.)
Preparing to unpack .../python3-apport_2.20.11-0ubuntu27.21_all.deb ...
python3: can't open file 'C:\\usr\\bin\\py3clean': [Errno 2] No such file or directory
dpkg: warning: old python3-apport package pre-removal script subprocess returned error exit status 2
dpkg: trying script from the new package instead ...
python3: can't open file 'C:\\usr\\bin\\py3clean': [Errno 2] No such file or directory
dpkg: error processing archive /var/cache/apt/archives/python3-apport_2.20.11-0ubuntu27.21_all.deb (--unpack):
 new python3-apport package pre-removal script subprocess returned error exit status 2
python3: can't open file 'C:\\usr\\bin\\py3compile': [Errno 2] No such file or directory
dpkg: error while cleaning up:
 installed python3-apport package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/python3-apport_2.20.11-0ubuntu27.21_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

py3clean 文件存在:

$ ll /usr/bin/ | grep py3
-rwxr-xr-x 1 root   root        7813 Mar 13  2020 py3clean*
-rwxr-xr-x 1 root   root       12120 Mar 13  2020 py3compile*
lrwxrwxrwx 1 root   root          31 Mar 13  2020 py3versions -> ../share/python3/py3versions.py*

相关内容