# Stuck upgrading parts of 3.10 from 3.10.3 to 3.10.4

**URL:** https://discuss.python.org/t/stuck-upgrading-parts-of-3-10-from-3-10-3-to-3-10-4/15183
**Category:** Python Help
**Tags:** help
**Created:** [April 20, 2022, 1:30pm UTC](https://discuss.python.org/t/stuck-upgrading-parts-of-3-10-from-3-10-3-to-3-10-4/15183 "2022-04-20T13:30:56Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![smontanaro](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/smontanaro/32/1389_2.png) [@smontanaro](https://discuss.python.org/u/smontanaro)
#### Post date: [April 20, 2022, 1:30pm UTC](https://discuss.python.org/t/stuck-upgrading-parts-of-3-10-from-3-10-3-to-3-10-4/15183/1 "2022-04-20T13:30:56Z")

</div>

This isn’t strictly speaking a Python issue, but it involves upgrade of Python on a Debian-like system (whatever Oracle calls their Linux). I use 3.10 on my website, and Oracle told me there were some updates to perform, so I executed:

> apt update  
> apt upgrade

That worked except for two packages which seem stuck:

> % 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.3-1+focal1 is installed  
> python3.10-minimal : Depends: libpython3.10-minimal (= 3.10.4-1+focal2) but 3.10.3-1+focal1 is installed  
> E: Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).

I tried the suggested fix but that didn’t help:

> % apt --fix-broken install  
> Reading package lists… Done  
> Building dependency tree  
> … …  
> Unpacking libpython3.10-stdlib:amd64 (3.10.4-1+focal2) over (3.10.3-1+focal1) …  
> … …  
> Unpacking libpython3.10-minimal:amd64 (3.10.4-1+focal2) over (3.10.3-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.3-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)

It would appear that I am actually at 3.10.4:

> % apt list | egrep ‘python3.10.\*3.10.4’
> 
> WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
> 
> idle-python3.10/focal 3.10.4-1+focal2 all  
> libpython3.10-dbg/focal 3.10.4-1+focal2 amd64  
> libpython3.10-dev/focal 3.10.4-1+focal2 amd64  
> libpython3.10-minimal/focal 3.10.4-1+focal2 amd64 [upgradable from: 3.10.3-1+focal1]  
> libpython3.10-stdlib/focal 3.10.4-1+focal2 amd64 [upgradable from: 3.10.3-1+focal1]  
> libpython3.10-testsuite/focal 3.10.4-1+focal2 all  
> libpython3.10/focal 3.10.4-1+focal2 amd64  
> libqgispython3.10.4/focal 3.10.4+dfsg-1ubuntu2 amd64  
> python3.10-dbg/focal 3.10.4-1+focal2 amd64  
> python3.10-dev/focal 3.10.4-1+focal2 amd64  
> python3.10-distutils/focal,now 3.10.4-1+focal2 all [installed,automatic]  
> python3.10-examples/focal 3.10.4-1+focal2 all  
> python3.10-full/focal 3.10.4-1+focal2 amd64  
> python3.10-gdbm-dbg/focal 3.10.4-1+focal2 amd64  
> python3.10-gdbm/focal 3.10.4-1+focal2 amd64  
> python3.10-lib2to3/focal,now 3.10.4-1+focal2 all [installed,automatic]  
> python3.10-minimal/focal,now 3.10.4-1+focal2 amd64 [installed,automatic]  
> python3.10-tk-dbg/focal 3.10.4-1+focal2 amd64  
> python3.10-tk/focal 3.10.4-1+focal2 amd64  
> python3.10-venv/focal,now 3.10.4-1+focal2 amd64 [installed]  
> python3.10/focal,now 3.10.4-1+focal2 amd64 [installed]  
> % python3.10  
> Python 3.10.4 (main, Apr 8 2022, 17:35:13) [GCC 9.4.0] on linux  
> Type “help”, “copyright”, “credits” or “license” for more information.

but there is some record wrong in some `dpkg` database.

> % apt list -a libpython3.10-minimal  
> Listing… Done  
> libpython3.10-minimal/focal 3.10.4-1+focal2 amd64 [upgradable from: 3.10.3-1+focal1]  
> libpython3.10-minimal/now 3.10.3-1+focal1 amd64 [installed,upgradable to: 3.10.4-1+focal2]
> 
> % apt list -a python3.10  
> Listing… Done  
> python3.10/focal,now 3.10.4-1+focal2 amd64 [installed]

I am unclear how to proceed from here. Any suggestions for how to fix this (or where a better place to ask this not-really-python question)?

---

<div class="post-metadata">

### Author: ![rob42](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/rob42/32/8218_2.png) [@rob42](https://discuss.python.org/u/rob42)
#### Post date: [April 20, 2022, 1:45pm UTC](https://discuss.python.org/t/stuck-upgrading-parts-of-3-10-from-3-10-3-to-3-10-4/15183/2 "2022-04-20T13:45:27Z")

</div>

The first thing I’d try is:

```bash
apt autoremove
apt autoclean

```

Then try the `update` and `upgrade` again.

---

<div class="post-metadata">

### Author: ![fungi](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/fungi/32/5963_2.png) [@fungi](https://discuss.python.org/u/fungi)
#### Post date: [April 20, 2022, 2:07pm UTC](https://discuss.python.org/t/stuck-upgrading-parts-of-3-10-from-3-10-3-to-3-10-4/15183/3 "2022-04-20T14:07:14Z")

</div>

This doesn’t look like Oracle Linux, which is a RHEL/RPM derived  
distribution. The use of APT/DEB packages and references to “focal”  
in package revisions make me suspect it’s something based on Ubuntu  
20.04 LTS, however that Ubuntu release doesn’t have any official  
Python 3.10 packages (not yet anyway, though I’m told supported  
backports are in the works).

The short answer is that it looks like whoever is maintaining these  
3.10 packages decided to move the typing.py module from  
libpython3.10-stdlib (which normally houses the majority of Python’s  
“batteries included” standard library of modules) to the  
libpython3.10-minimal package (which includes the more commonly used  
remainder of modules), or otherwise accidentally included the file  
in both packages. Since I don’t know where you obtained these  
packages, it’s hard to inspect them to know exactly which is the  
case.

For the record, the Python 3.10 packages in Debian sid/bookworm and  
Ubuntu releases from 21.04 (where they were first included) to  
current all include typing.py in the minimal set, not the stdlib  
package. This looks like a transitional problem created by whoever  
is maintaining the packages you’re using, and your best bet is to  
reach out to them for assistance rather than trying to perform  
surgery on your package database.

---

<div class="post-metadata">

### Author: ![smontanaro](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/smontanaro/32/1389_2.png) [@smontanaro](https://discuss.python.org/u/smontanaro)
#### Post date: [April 20, 2022, 2:13pm UTC](https://discuss.python.org/t/stuck-upgrading-parts-of-3-10-from-3-10-3-to-3-10-4/15183/4 "2022-04-20T14:13:33Z")

</div>

Thanks for the suggestion. I do recognize the maintainer. I’ll reach out to him directly.

(As for autoremove & autoclean, the former is stmied by the apparent conflict, the latter seems to do nothing.)

---

<div class="post-metadata">

### Author: ![smontanaro](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/smontanaro/32/1389_2.png) [@smontanaro](https://discuss.python.org/u/smontanaro)
#### Post date: [April 20, 2022, 7:34pm UTC](https://discuss.python.org/t/stuck-upgrading-parts-of-3-10-from-3-10-3-to-3-10-4/15183/5 "2022-04-20T19:34:40Z")

</div>

> [@fungi](#):
>
> This doesn’t look like Oracle Linux, which is a RHEL/RPM derived  
> distribution.

Yeah, my bad. It is some flavor of Ubuntu 20.04:

> % uname -a  
> Linux instance-20211222-1239 5.13.0-1021-oracle #26~20.04.1-Ubuntu SMP Mon Mar 7 14:26:06 UTC 2022 x86\_64 x86\_64 x86\_64 GNU/Linux

Once I got the instance up and running, I have basically just ignored it. Previous updates all worked just fine. This is the first problem I’ve encountered with an upgrade.

---

<div class="post-metadata">

### Author: ![smontanaro](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/smontanaro/32/1389_2.png) [@smontanaro](https://discuss.python.org/u/smontanaro)
#### Post date: [April 22, 2022, 9:16pm UTC](https://discuss.python.org/t/stuck-upgrading-parts-of-3-10-from-3-10-3-to-3-10-4/15183/6 "2022-04-22T21:16:59Z")

</div>

Closing this out with my eventual solution in case others encounter the same (or similar) problem. The checked answer on this AskUbuntu question

> <https://askubuntu.com/questions/176121/dpkg-error-trying-to-overwrite-file-which-is-also-in>

provided the solution, effectively purge the offending packages and reinstall. I have yet to restart nginx or my gunicorn instance (which is what uses Python), so I may encounter other problems. I’ll get to that eventually. For now, the website is up.
