18

Here are the error logs which I get try to update the dependency. I feel --overwrite flag can do the job with "dpkg" but I am not sure whether to use it or not as I see some cross dependency down there. Thank you so much for your help.

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 policy libpython3.6-stdlib python3-lib2to3
gives this

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

`

abu_bua
  • 1,361
  • 17
  • 25
vipulbhj
  • 710
  • 5
  • 21
  • Please can you add the output of the command `apt-cache policy libpython3.6-stdlib python3-lib2to3` to your question? – ash May 17 '18 at 21:58
  • 1
    I'm getting this, installing on Ubuntu 16.04 from ppa:jonathonf/python-3.6 repo – Nexus May 17 '18 at 23:21
  • @Josh apt-cache policy libpython3.6-stdlib python3-lib2to3 looks like above – vipulbhj May 18 '18 at 06:07

3 Answers3

42

Try this command:

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

It solved same issue (hope without any broken)

abu_bua
  • 1,361
  • 17
  • 25
zguest
  • 446
  • 4
  • 2
  • This did it I guess, now visible problems till now. Thank you so much – vipulbhj May 18 '18 at 22:30
  • This did it for me as well, but at some points the package wasn't in `archives/`. I got a lot of messages about overwriting things, but afterwards `apt upgrade` completed successfully. Thanks! – Andrew Jun 11 '18 at 07:23
  • 2
    what's causing this issue? – Alex Bender Jun 28 '18 at 13:44
  • 3
    Same problem (but with python 3.7). Fixed with this, but I'd very much be interested in what causes this – Chris Jun 13 '19 at 19:19
  • had a slightly different file that was giving me issues, but just copying the filename and doing the same `sudo dpkg --install --force all ` on it worked for me too! (old Ubuntu 16.04 desktop) – Henry van Megen Dec 20 '21 at 09:57
  • Just had the same issue with `libpython3.10` (`libpython3.10-minimal_3.10.4-1+bionic2_amd64.deb` and `libpython3.10-minimal_3.10.4-1+bionic2_amd64.deb`). Is that an issue with package deps definitions ? It seem logical that these two packages share a conflicting file. The problem seems to be that other packages depend on stdlib vs minimal version of it. Perhaps our package managers cannot deal with `stdlib` version being a superset of `minimal`, thus a valid replacement or such... – smido Apr 14 '22 at 13:43
1

Looks like this issue except with a different package: python3-lib2to3 instead of scala. Try purging the problem package with

sudo dpkg -P python3-lib2to3

I had this same problem with python3-tk and that fixed it for me.

  • are you sure, isn't the cross dependency an issue here ?? – vipulbhj May 17 '18 at 18:57
  • 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 i mean this line btw – vipulbhj May 17 '18 at 18:59
  • `sudo dpkg -P python3-lib2to3 [sudo] password for asmuth: dpkg: dependency problems prevent removal of python3-lib2to3: python3-distutils depends on python3-lib2to3 (>= 3.6.4). dpkg: error processing package python3-lib2to3 (--purge): dependency problems - not removing Errors were encountered while processing: python3-lib2to3` – vipulbhj May 17 '18 at 19:00
  • Oh fun. :( Despite the similar error message in your original question, your problem seems a bit more complex than mine or the one in the issue I linked. If I were in your place, I might try purging python3-distutils. If things are in a weird dependency state, starting fresh may help. However, I'm not sure that's good advice. :) Sorry I can't be more helpful. Good luck! – Krista Davis May 17 '18 at 19:08
1

In my case I downloaded

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

And then

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

And Done! I got it back!

This post was the first one that worked for me after updating to Mint 19.

Isma
  • 14,604
  • 5
  • 37
  • 51
Neoecos
  • 569
  • 4
  • 16