Score:0

cannot run sudo apt --fix-broken install

us flag

I am running Ubuntu 18.04.6 LTS. I cannot use sudo apt install anything The error I get is:

[sudo] password for username: 
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.
 libpython3.9 : Depends: libpython3.9-stdlib (= 3.9.15-1+bionic1) but 3.9.5-1+bionic1 is to be installed
 libpython3.9-dev : Depends: libpython3.9-stdlib (= 3.9.15-1+bionic1) but 3.9.5-1+bionic1 is to be installed
 python3.9 : Depends: libpython3.9-stdlib (= 3.9.15-1+bionic1) but 3.9.5-1+bionic1 is to be installed
 python3.9-minimal : Depends: libpython3.9-minimal (= 3.9.15-1+bionic1) but 3.9.5-1+bionic1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

So I try: apt --fix-broken install

and I get this error:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libllvm7 libllvm9 linux-headers-5.4.0-73-generic linux-hwe-5.4-headers-5.4.0-73 linux-image-5.4.0-73-generic
  linux-modules-5.4.0-73-generic linux-modules-extra-5.4.0-73-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libpython3.9-minimal libpython3.9-stdlib
The following packages will be upgraded:
  libpython3.9-minimal libpython3.9-stdlib
2 to upgrade, 0 to newly install, 0 to remove and 152 not to upgrade.
6 not fully installed or removed.
Need to get 0 B/2,486 kB of archives.
After this operation, 73.7 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 214069 files and directories currently installed.)
Preparing to unpack .../libpython3.9-stdlib_3.9.16-1+bionic1_amd64.deb ...
Unpacking libpython3.9-stdlib:amd64 (3.9.16-1+bionic1) over (3.9.5-1+bionic1) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.9-stdlib_3.9.16-1+bionic1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3.9/_sysconfigdata__linux_x86_64-linux-gnu.py', which is also in package libpython3.9-minimal:amd64 3.9.5-1+bionic1
Preparing to unpack .../libpython3.9-minimal_3.9.16-1+bionic1_amd64.deb ...
Unpacking libpython3.9-minimal:amd64 (3.9.16-1+bionic1) over (3.9.5-1+bionic1) ...
dpkg: error processing archive /var/cache/apt/archives/libpython3.9-minimal_3.9.16-1+bionic1_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/python3.9/typing.py', which is also in package libpython3.9-stdlib:amd64 3.9.5-1+bionic1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libpython3.9-stdlib_3.9.16-1+bionic1_amd64.deb
 /var/cache/apt/archives/libpython3.9-minimal_3.9.16-1+bionic1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have also tried the "Software Updater" and it also reports an error suggesting I try: sudo apt-get install -f

This also fails with the same (Broken pipe) error as above.

I seem to be going around in circles. Does anyone have any suggestion as to what I can do next?

HuHa avatar
es flag
Please add some formatting to make that readable.
uz flag
Jos
Try to remove the package `libpython3.9-minimal` first.
ChrisBon avatar
us flag
@Jos, Thanks for your suggestion, I am new to installing and uninstalling things in Linux, so please can you give me a command to use to: "remove package libpython3.9-minimal first" ?
uz flag
Jos
That would be `sudo apt remove libpython3.9-minimal`. However, if that command replies with a suggestion to remove much else besides this one package, then don't press "y", or you might make things worse.
ChrisBon avatar
us flag
@Jos - I did that and got: The following packages have unmet dependencies. libpython3.9 : Depends: libpython3.9-stdlib (= 3.9.16-1+bionic1) but 3.9.5-1+bionic1 is to be installed ... too much to include here, plus another suggestion to: Try 'apt --fix-broken install' with no packages (or specify a solution).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.