dpkg-dep错误:粘贴子进程被Ubuntu WSL 2的信号(管道中断)终止

nwo49xxi  于 2022-11-02  发布在  其他
关注(0)|答案(2)|浏览(294)

你好,我在Windows 10(21h2)机器上的wsl2上使用ubunutu。我正在更新我的apt软件包。然后当我把升级命令放在标题中时,发生了错误。

sasenp@DESKTOP-0NSS9RI:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 python3.10 : Depends: libpython3.10-stdlib (= 3.10.4-1+focal2) but 3.10.2-1+focal1 is installed
 python3.10-minimal : Depends: libpython3.10-minimal (= 3.10.4-1+focal2) but 3.10.2-1+focal1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

当我试图修复损坏的安装时,我得到了这个

sasenp@DESKTOP-0NSS9RI:~$ sudo apt --fix-broken install
The following package was automatically installed and is no longer required:
  libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libpython3.10-minimal libpython3.10-stdlib
The following packages will be upgraded:
  libpython3.10-minimal libpython3.10-stdlib
2 upgraded, 0 newly installed, 0 to remove and 92 not upgraded.
119 not fully installed or removed.
Need to get 0 B/2566 kB of archives.
After this operation, 62.5 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 125300 files and directories currently installed.)
Preparing to unpack .../libpython3.10-stdlib_3.10.4-1+focal2_amd64.deb ...
Unpacking libpython3.10-stdlib:amd64 (3.10.4-1+focal2) over (3.10.2-1+focal1) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.10-stdlib_3.10.4-1+focal2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3.10/_sysconfigdata__linux_x86_64-linux-gnu.py', which is also in package libpythonThe following package was automatically installed and is no longer required:
  libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libpython3.10-minimal libpython3.10-stdlib
The following packages will be upgraded:
  libpython3.10-minimal libpython3.10-stdlib
2 upgraded, 0 newly installed, 0 to remove and 92 not upgraded.
119 not fully installed or removed.
Need to get 0 B/2566 kB of archives.
After this operation, 62.5 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 125300 files and directories currently installed.)
Preparing to unpack .../libpython3.10-stdlib_3.10.4-1+focal2_amd64.deb ...
Unpacking libpython3.10-stdlib:amd64 (3.10.4-1+focal2) over (3.10.2-1+focal1) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.10-stdlib_3.10.4-1+focal2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3.10/_sysconfigdata__linux_x86_64-linux-gnu.py', which is also in package libpython3.10-minimal:amd64 3.10.2-1+focal1
Preparing to unpack .../libpython3.10-minimal_3.10.4-1+focal2_amd64.deb ...
Unpacking libpython3.10-minimal:amd64 (3.10.4-1+focal2) over (3.10.2-1+focal1) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.10-minimal_3.10.4-1+focal2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3.10/typing.py', which is also in package libpython3.10-stdlib:amd64 3.10.2-1+focal1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libpython3.10-stdlib_3.10.4-1+focal2_amd64.deb
 /var/cache/apt/archives/libpython3.10-minimal_3.10.4-1+focal2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我能做些什么来解决这个问题?

rryofs0p

rryofs0p1#

看来我已经解决了这个问题。

sudo dpkg -i --force-overwrite [the path to the libpython3.10 archive folder]

然后再

sudo apt -f install
cx6n0qe3

cx6n0qe32#

你可以试试

sudo dpkg -i --force-overwrite /var/cache/apt/archives/nvidia-340_340.107-0ubuntu0~gpu18.04.1_amd64.deb

sudo apt -f install

以修复任何损坏的软件包。

相关问题