October 24, 2024
Chicago 12, Melborne City, USA
python

APT broken due to broken python libraries


I am on Debian 12.
I made a rookie error installing python libraries (numpy, pandas, sklearn) using apt and now whenever i try to install or uninstall anything i get this error.

When installing

thedude@192:~$ sudo apt install sl
[sudo] password for thedude: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 python3-bottleneck : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                      Depends: python3-numpy-abi9
 python3-contourpy : Depends: python3-numpy but it is not going to be installed
 python3-matplotlib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                      Depends: python3-numpy-abi9
 python3-numexpr : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                   Depends: python3-numpy-abi9
 python3-pandas : Depends: python3-numpy but it is not going to be installed
                  Depends: python3-numpy (>= 1:1.18.5~) but it is not going to be installed or
                           python3 (< 3.10) but 3.11.2-1+b1 is to be installed
 python3-pandas-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                      Depends: python3-numpy-abi9
                      Recommends: python3-numba but it is not going to be installed
 python3-pythran : Depends: python3-numpy but it is not going to be installed
 python3-scipy : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                 Depends: python3-numpy-abi9
 python3-sklearn : Depends: python3-numpy but it is not going to be installed
 python3-sklearn-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                       Depends: python3-numpy-abi9
 python3-tables : Depends: python3-numpy but it is not going to be installed
 python3-tables-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                      Depends: python3-numpy-abi9
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

When Uninstalling:

thedude@192:~$ sudo apt remove python3-numpy
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'python3-numpy' is not installed, so not removed
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 python3-bottleneck : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                      Depends: python3-numpy-abi9
 python3-contourpy : Depends: python3-numpy but it is not going to be installed
 python3-matplotlib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                      Depends: python3-numpy-abi9
 python3-numexpr : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                   Depends: python3-numpy-abi9
 python3-pandas : Depends: python3-numpy but it is not going to be installed
                  Depends: python3-numpy (>= 1:1.18.5~) but it is not going to be installed or
                           python3 (< 3.10) but 3.11.2-1+b1 is to be installed
 python3-pandas-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                      Depends: python3-numpy-abi9
                      Recommends: python3-numba but it is not going to be installed
 python3-pythran : Depends: python3-numpy but it is not going to be installed
 python3-scipy : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                 Depends: python3-numpy-abi9
 python3-sklearn : Depends: python3-numpy but it is not going to be installed
 python3-sklearn-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                       Depends: python3-numpy-abi9
 python3-tables : Depends: python3-numpy but it is not going to be installed
 python3-tables-lib : Depends: python3-numpy (>= 1:1.22.0) but it is not going to be installed
                      Depends: python3-numpy-abi9
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

I tried apt fix-broken install as the error message suggests.

thedude@192:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  fonts-lato icu-devtools libclang-cpp14 libffi-dev libicu-dev libllvm14
  libncurses-dev libpfm4 libtinfo-dev libxml2-dev libz3-dev
  llvm-14-linker-tools llvm-14-runtime llvm-14-tools nss-plugin-pem
  python3-yaml sphinx-rtd-theme-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  python3-numpy
Suggested packages:
  gfortran
The following NEW packages will be installed:
  python3-numpy
0 upgraded, 1 newly installed, 0 to remove and 27 not upgraded.
Need to get 5,209 kB of archives.
After this operation, 28.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://deb.debian.org/debian bookworm/main amd64 python3-numpy amd64 1:1.24.2-1
  404  Not Found [IP: 146.75.54.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/n/numpy/python3-numpy_1.24.2-1_amd64.deb  404  Not Found [IP: 146.75.54.132 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

My understanding is that the library that is generating the error is numpy.
I found out that it is installed by typing:

thedude@192:~$ sudo apt list python3-numpy
Listing... Done
python3-numpy/stable 1:1.24.2-1 amd64

But as shown I cant remove it.
I tried updating and also --fix-missing and also autoremove

thedude@192:~$ sudo apt --fix-broken install --fix-missing
[sudo] password for thedude: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  fonts-lato icu-devtools libclang-cpp14 libffi-dev libicu-dev libllvm14
  libncurses-dev libpfm4 libtinfo-dev libxml2-dev libz3-dev
  llvm-14-linker-tools llvm-14-runtime llvm-14-tools nss-plugin-pem
  python3-yaml sphinx-rtd-theme-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  python3-numpy
Suggested packages:
  gfortran
The following NEW packages will be installed:
  python3-numpy
0 upgraded, 1 newly installed, 0 to remove and 27 not upgraded.
Need to get 5,209 kB of archives.
After this operation, 28.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://deb.debian.org/debian bookworm/main amd64 python3-numpy amd64 1:1.24.2-1
  404  Not Found [IP: 146.75.54.132 80]
Unable to correct missing packages.
E: Failed to fetch http://deb.debian.org/debian/pool/main/n/numpy/python3-numpy_1.24.2-1_amd64.deb  404  Not Found [IP: 146.75.54.132 80]
E: Aborting install.

Tried update works fine but makes no differenze.

Is there anything i can do to fix this?



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video