Estou no Debian 12. Cometi um erro de novato ao instalar bibliotecas Python (numpy, pandas, sklearn) usando o apt e agora sempre que tento instalar ou desinstalar alguma coisa recebo esse erro.
Ao instalar
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).
Ao desinstalar:
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).
Tentei apt fix-broken install
como a mensagem de erro sugere.
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?
Meu entendimento é que a biblioteca que está gerando o erro é numpy. Descobri que ela é instalada digitando:
thedude@192:~$ sudo apt list python3-numpy
Listing... Done
python3-numpy/stable 1:1.24.2-1 amd64
Mas como mostrado não consigo removê-lo. Tentei atualizar e também --fix-missing
e tambémautoremove
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.
Tentei update
e funciona bem, mas não faz diferença.
Há algo que eu possa fazer para consertar isso?
Créditos para @Stephen Kitt que sugeriu esta resposta nos comentários. Resolvi fazendo
A essência do erro “404 Not Found”. É um código de status HTTP que indica que o recurso solicitado não pôde ser encontrado no servidor. No contexto do apt-get, isso significa que o pacote que você está tentando acessar não foi encontrado no servidor do repositório.
Execute
sudo apt update
e tente instalar novamentepython3-numpy
.Também é um bom hábito executar
sudo apt update
e depoissudo apt upgrade
antes de instalar os pacotes.