尝试更新 libpython3.6-stdlib 导致覆盖错误

Trying to update libpython3.6-stdlib results in overwrite error

这是我尝试更新依赖项时得到的错误日志。 我觉得 --overwrite 标志可以用 "dpkg" 完成这项工作,但我不确定是否使用它,因为我看到那里存在一些交叉依赖。 非常感谢您的帮助。

sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  libpython3.6-stdlib
The following packages will be upgraded:
  libpython3.6-stdlib
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
8 not fully installed or removed.
Need to get 0 B/1,989 kB of archives.
After this operation, 1,393 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 225358 files and directories currently installed.)
Preparing to unpack .../libpython3.6-stdlib_3.6.5-5~16.04.york1_amd64.deb ...
Unpacking libpython3.6-stdlib:amd64 (3.6.5-5~16.04.york1) over (3.6.5-5~16.04.york0) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.6-stdlib_3.6.5-5~16.04.york1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3.6/lib2to3/refactor.py', which is also in package python3-lib2to3 3.6.5-3~16.04.york0.2
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libpython3.6-stdlib_3.6.5-5~16.04.york1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

apt-cache 策略库python3.6-stdlib python3-lib2to3
给出这个

libpython3.6-stdlib:
  Installed: 3.6.5-5~16.04.york0
  Candidate: 3.6.5-5~16.04.york1
  Version table:
     3.6.5-5~16.04.york1 500
        500 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 Packages
 *** 3.6.5-5~16.04.york0 100
        100 /var/lib/dpkg/status
python3-lib2to3:
  Installed: 3.6.5-3~16.04.york0.2
  Candidate: 3.6.5-3~16.04.york0.2
  Version table:
 *** 3.6.5-3~16.04.york0.2 500
        500 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 Packages
        500 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main i386 Packages
        100 /var/lib/dpkg/status

`

看起来像 this issue 除了使用不同的包:python3-lib2to3 而不是 scala。尝试用

清除问题包
sudo dpkg -P python3-lib2to3

我在使用 python3-tk 时遇到了同样的问题,我已经解决了。

试试这个命令:

sudo dpkg --install --force all /var/cache/apt/archives/libpython3.6-stdlib_3.6.5-5~16.04.york1_amd64.deb

解决了同样的问题(希望没有坏掉)

就我而言,我下载了

sudo apt-get download python3.6=3.6.5-3 python3.6-minimal=3.6.5-3 libpython3.6-stdlib=3.6.5-3 libpython3.6-minimal=3.6.5-3

然后

sudo dpkg -i --force-downgrade \*3.6.5\*

完成!我拿回来了!

这个 post 是我更新到 Mint 19 后第一个对我有用的。