0
krishna@Krishna-PC:~$ sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of python3.10:
 python3.10 depends on libpython3.10-stdlib (= 3.10.4-1+focal2); however:
  Version of libpython3.10-stdlib:amd64 on system is 3.10.4-1+focal1.

dpkg: error processing package python3.10 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3.10-minimal:
 python3.10-minimal depends on libpython3.10-minimal (= 3.10.4-1+focal2); however:
  Version of libpython3.10-minimal:amd64 on system is 3.10.4-1+focal1.

dpkg: error processing package python3.10-minimal (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python3.10
 python3.10-minimal

AND WHEN I TRY TO "SUDO APT --FIX-BROKEN INSTALL"

$ sudo apt --fix-broken install 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
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 11 not upgraded.
2 not fully installed or removed.
Need to get 0 B/2,566 kB of archives.
After this operation, 68.6 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 204340 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.4-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 als
o in package libpython3.10-minimal:amd64 3.10.4-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.4-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-stdli
b:amd64 3.10.4-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)
Soren A
  • 6,442
  • 2
  • 17
  • 33
krishna
  • 11
  • 1
  • 2
    Does this answer your question? [dpkg error: "trying to overwrite file, which is also in..."](https://askubuntu.com/questions/176121/dpkg-error-trying-to-overwrite-file-which-is-also-in) – karel Apr 15 '22 at 14:03
  • Have any PPAs been added to your software sources? – karel Apr 15 '22 at 14:06
  • Hello. What version of Ubuntu are you running? No current version uses python 3.10 – David Apr 15 '22 at 14:33
  • 1
    please avoid gratuitous use of capital letters. It adds nothing to your question and can be regarded as shouting and there rude. – graham Apr 15 '22 at 17:10

3 Answers3

1

I just ran into the same problem. The answer is in the link provided by @karel but the exact step I took was:

~ $ sudo dpkg -i --force-overwrite /var/cache/apt/archives/libpython3.10-minimal_3.10.4-1+focal2_amd64.deb

This reduces the overwrite error to a warning and completes the install of the package.

After this you can 'sudo apt --fix-broken install' to complete the upgrades successfully.

Whippy
  • 751
  • 1
  • 7
  • 19
1

A crude solution would be to force an overwrite.

sudo apt --fix-broken -o DPkg::Options::=--force-overwrite install

Similar as @Whippy 's answer, but you don't need to find and specify the debs.

Herbert
  • 205
  • 1
  • 2
  • 10
0

This issue already fixed in github of the Deadsnakes PPA's

sudo apt --fix-missing purge $(dpkg -l | grep 'python3\.10' | awk '{print $2}')

or

sudo apt purge libpython3.10-minimal libpython3.10-stdlib libpython3.10 libpython3.10-dev python3.10 python3.10-minimal python3.10-dev python3.10-venv
sudo apt install python3.10

Hope this helps.

abu-ahmed al-khatiri
  • 1,699
  • 13
  • 33