thumb

Recently, when attempting to update the software of my Raspberry Pi to the latest version using the sudo apt-get upgrade command in the terminal, I saw an error message saying E: Failed to fetch http://{:url}{:package}.deb 404 Not Found [IP: {:ip} 80]. In this tutorial, you will learn what causes this error message and how to fix it.

How to fix: E: Failed to fetch http://{:url}{:package}.deb 404 Not Found [IP: {:ip} 80]

What causes this error

In my case, the below error appeared when attempting to run the sudo apt-get upgrade command after the sudo apt-get update in the terminal of my Raspberry Pi with the Raspbian 10 installed. However, you may run into this problem on any Linux computer with Debian-like OS.

sudo apt-get update
Get:1 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Get:4 http://archive.raspberrypi.org/debian buster/main armhf Packages [330 kB]
Fetched 13.4 MB in 48s (279 kB/s)                                                                                                                                                                          
Reading package lists... Done
sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  binutils binutils-arm-linux-gnueabihf binutils-common libbinutils libgl1-mesa-dri libjavascriptcoregtk-4.0-18 libvlc-bin libvlc5 libwebkit2gtk-4.0-37 mesa-va-drivers mesa-vdpau-drivers pcmanfm
  python-rpi.gpio python3-rpi.gpio raspberrypi-sys-mods raspberrypi-ui-mods vlc vlc-bin vlc-data vlc-plugin-base vlc-plugin-qt vlc-plugin-skins2 vlc-plugin-video-output
The following packages will be upgraded:
  arandr bind9-host bluez-firmware ca-certificates dnsutils dphys-swapfile gtk2-engines-clearlookspix libbind9-161 libdns-export1104 libdns1104 libfm-data libfm-extra4 libfm-gtk-data libfm-gtk4
  libfm-modules libfm4 libgnutls30 libirs161 libisc-export1100 libisc1100 libisccc161 libisccfg163 liblwres161 libobrender32v5 libobt2v5 libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc
  libraspberrypi0 libvlccore9 lxpanel lxpanel-data lxplug-bluetooth lxplug-ejecter lxplug-network lxplug-ptbatt lxplug-volume obconf openbox pi-bluetooth pi-greeter pi-package pi-package-data
  pi-package-session piclone pipanel piwiz raspberrypi-bootloader raspberrypi-kernel raspi-config rc-gui rp-prefapps rpd-plym-splash rpi-chromium-mods
54 upgraded, 0 newly installed, 0 to remove and 23 not upgraded.
Need to get 4,574 kB/129 MB of archives.
After this operation, 1,051 kB disk space will be freed.
Do you want to continue? [Y/n] y
Err:1 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf bind9-host armhf 1:9.11.5.P4+dfsg-5.1+deb10u1
  404  Not Found [IP: 213.180.204.183 80]
Err:2 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf dnsutils armhf 1:9.11.5.P4+dfsg-5.1+deb10u1
  404  Not Found [IP: 213.180.204.183 80]
Err:3 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libbind9-161 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1
  404  Not Found [IP: 213.180.204.183 80]
Err:4 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libisccfg163 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1
  404  Not Found [IP: 213.180.204.183 80]
Err:5 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libisccc161 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1
  404  Not Found [IP: 213.180.204.183 80]
Err:6 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libirs161 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1
  404  Not Found [IP: 213.180.204.183 80]
Err:7 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libdns1104 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1
  404  Not Found [IP: 213.180.204.183 80]
Err:8 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libisc1100 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1
  404  Not Found [IP: 213.180.204.183 80]
Err:9 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf liblwres161 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1
  404  Not Found [IP: 213.180.204.183 80]
Err:10 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libisc-export1100 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1
  404  Not Found [IP: 213.180.204.183 80]
Err:11 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libdns-export1104 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1
  404  Not Found [IP: 213.180.204.183 80]
E: Failed to fetch http://mirror.yandex.ru/mirrors/raspbian/raspbian/pool/main/b/bind9/bind9-host_9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb  404  Not Found [IP: 213.180.204.183 80]
E: Failed to fetch http://mirror.yandex.ru/mirrors/raspbian/raspbian/pool/main/b/bind9/dnsutils_9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb  404  Not Found [IP: 213.180.204.183 80]
E: Failed to fetch http://mirror.yandex.ru/mirrors/raspbian/raspbian/pool/main/b/bind9/libbind9-161_9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb  404  Not Found [IP: 213.180.204.183 80]
E: Failed to fetch http://mirror.yandex.ru/mirrors/raspbian/raspbian/pool/main/b/bind9/libisccfg163_9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb  404  Not Found [IP: 213.180.204.183 80]
E: Failed to fetch http://mirror.yandex.ru/mirrors/raspbian/raspbian/pool/main/b/bind9/libisccc161_9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb  404  Not Found [IP: 213.180.204.183 80]
E: Failed to fetch http://mirror.yandex.ru/mirrors/raspbian/raspbian/pool/main/b/bind9/libirs161_9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb  404  Not Found [IP: 213.180.204.183 80]
E: Failed to fetch http://mirror.yandex.ru/mirrors/raspbian/raspbian/pool/main/b/bind9/libdns1104_9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb  404  Not Found [IP: 213.180.204.183 80]
E: Failed to fetch http://mirror.yandex.ru/mirrors/raspbian/raspbian/pool/main/b/bind9/libisc1100_9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb  404  Not Found [IP: 213.180.204.183 80]
E: Failed to fetch http://mirror.yandex.ru/mirrors/raspbian/raspbian/pool/main/b/bind9/liblwres161_9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb  404  Not Found [IP: 213.180.204.183 80]
E: Failed to fetch http://mirror.yandex.ru/mirrors/raspbian/raspbian/pool/main/b/bind9/libisc-export1100_9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb  404  Not Found [IP: 213.180.204.183 80]
E: Failed to fetch http://mirror.yandex.ru/mirrors/raspbian/raspbian/pool/main/b/bind9/libdns-export1104_9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb  404  Not Found [IP: 213.180.204.183 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

The error message above is self explanatory. It saying that the system is unable to fetch some archives (a deb packages that contains the latest version of our software), and this is because the IP (in my case it is 213.180.204.183) is not found (error 404).

The indexes of available packages are fetched from the location(s) specified in the /etc/apt/sources.list file. When the location(s) specified in this file is outdated, we get the 404 error.

Now we know what caused this error.

How to solve it

Once we know what is causing the sudo apt-get upgrade command run to fail, we can use it to solve the problem. It is a really easy process. To solve this problem, we need to run the sudo apt-get update command but with the flag --fix-missing. Now, step by step guide.


Access the terminal of your Raspberry Pi. I use the SSH method to remotely connect to my Raspberry Pi from my laptop, but you can use any other method; telnet or direct access (using keyboard and monitor connected directly to your Raspberry Pi).


In the terminal, type the following command and press the Enter key to retrieve the updated indexes of available packages.

sudo apt-get update --fix-missing
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done

Temporarily disable your ad blocker. I use the Pi-hole as an ad blocker, and it turned out that it interferes with software updates. Perhaps I have set a too strict blocking list.


Finally, you can retype the command sudo apt-get upgrade to verify that it runs without the errors.

sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  binutils binutils-arm-linux-gnueabihf binutils-common libbinutils libgl1-mesa-dri libjavascriptcoregtk-4.0-18 libvlc-bin libvlc5 libwebkit2gtk-4.0-37 mesa-va-drivers mesa-vdpau-drivers pcmanfm
  python-rpi.gpio python3-rpi.gpio raspberrypi-sys-mods raspberrypi-ui-mods vlc vlc-bin vlc-data vlc-plugin-base vlc-plugin-qt vlc-plugin-skins2 vlc-plugin-video-output
The following packages will be upgraded:
  arandr bind9-host bluez-firmware ca-certificates dnsutils dphys-swapfile gtk2-engines-clearlookspix libbind9-161 libdns-export1104 libdns1104 libfm-data libfm-extra4 libfm-gtk-data libfm-gtk4
  libfm-modules libfm4 libgnutls30 libirs161 libisc-export1100 libisc1100 libisccc161 libisccfg163 liblwres161 libobrender32v5 libobt2v5 libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc
  libraspberrypi0 libvlccore9 lxpanel lxpanel-data lxplug-bluetooth lxplug-ejecter lxplug-network lxplug-ptbatt lxplug-volume obconf openbox pi-bluetooth pi-greeter pi-package pi-package-data
  pi-package-session piclone pipanel piwiz raspberrypi-bootloader raspberrypi-kernel raspi-config rc-gui rp-prefapps rpd-plym-splash rpi-chromium-mods
54 upgraded, 0 newly installed, 0 to remove and 23 not upgraded.
Need to get 4,574 kB/129 MB of archives.
After this operation, 1,051 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf bind9-host armhf 1:9.11.5.P4+dfsg-5.1+deb10u1 [268 kB]
Get:2 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf dnsutils armhf 1:9.11.5.P4+dfsg-5.1+deb10u1 [360 kB]
Get:3 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libbind9-161 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1 [243 kB]
Get:4 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libisccfg163 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1 [258 kB]
Get:5 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libisccc161 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1 [234 kB]
Get:6 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libirs161 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1 [235 kB]
Get:7 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libdns1104 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1 [1,078 kB]
Get:8 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libisc1100 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1 [422 kB]                                                                           
Get:9 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf liblwres161 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1 [246 kB]                                                                          
Get:10 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libisc-export1100 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1 [360 kB]                                                                   
Get:11 http://mirror.yandex.ru/mirrors/raspbian/raspbian buster/main armhf libdns-export1104 armhf 1:9.11.5.P4+dfsg-5.1+deb10u1 [871 kB]                                                                   
Fetched 4,574 kB in 16s (289 kB/s)                                                                                                                                                                         
Reading changelogs... Done
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 94543 files and directories currently installed.)
Preparing to unpack .../rpi-chromium-mods_20200602_armhf.deb ...
Unpacking rpi-chromium-mods (20200602) over (20200407) ...
Preparing to unpack .../libgnutls30_3.6.7-4+deb10u4_armhf.deb ...
Unpacking libgnutls30:armhf (3.6.7-4+deb10u4) over (3.6.7-4+deb10u3) ...
Setting up libgnutls30:armhf (3.6.7-4+deb10u4) ...
(Reading database ... 94543 files and directories currently installed.)
Preparing to unpack .../00-bind9-host_1%3a9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb ...
Unpacking bind9-host (1:9.11.5.P4+dfsg-5.1+deb10u1) over (1:9.11.5.P4+dfsg-5.1) ...
Preparing to unpack .../01-dnsutils_1%3a9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb ...
Unpacking dnsutils (1:9.11.5.P4+dfsg-5.1+deb10u1) over (1:9.11.5.P4+dfsg-5.1) ...
Preparing to unpack .../02-libbind9-161_1%3a9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb ...
Unpacking libbind9-161:armhf (1:9.11.5.P4+dfsg-5.1+deb10u1) over (1:9.11.5.P4+dfsg-5.1) ...
Preparing to unpack .../03-libisccfg163_1%3a9.11.5.P4+dfsg-5.1+deb10u1_armhf.deb ...
Unpacking libisccfg163:armhf (1:9.11.5.P4+dfsg-5.1+deb10u1) over (1:9.11.5.P4+dfsg-5.1) ...
...
Setting up pi-package-session (0.7) ...
Setting up openbox (3.6.1-8+rpt4) ...
Setting up piwiz (0.15) ...
Setting up libraspberrypi-dev (1.20200601-1) ...
Setting up lxplug-network (0.20) ...
Setting up libisccfg163:armhf (1:9.11.5.P4+dfsg-5.1+deb10u1) ...
Setting up lxplug-ejecter (0.10) ...
Setting up libbind9-161:armhf (1:9.11.5.P4+dfsg-5.1+deb10u1) ...
Setting up libirs161:armhf (1:9.11.5.P4+dfsg-5.1+deb10u1) ...
Setting up pipanel (1:1.5) ...
Setting up bind9-host (1:9.11.5.P4+dfsg-5.1+deb10u1) ...
Setting up dnsutils (1:9.11.5.P4+dfsg-5.1+deb10u1) ...
Processing triggers for desktop-file-utils (0.23-4) ...
Processing triggers for mime-support (3.62) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.31.4-3) ...
Processing triggers for libglib2.0-0:armhf (2.58.3-2+deb10u2) ...
Processing triggers for libc-bin (2.28-10+rpi1) ...
Processing triggers for systemd (241-7~deb10u4+rpi1) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for shared-mime-info (1.10-1) ...
Setting up pi-package (0.7) ...
Processing triggers for ca-certificates (20200601~deb10u1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.

No errors. It works!

Conclusion

That’s it, you’re done. Now the sudo apt-get update and then sudo apt-get upgrade command should run without the E: Failed to fetch http://{:url}{:package}.deb 404 Not Found [IP: {:ip} 80] error. So simple isn’t it?

If you are having trouble fixing this problem with the instructions above, but are being able to solve this problem with any another method please describe it in the comment section below. Thanks!

I hope this article has helped you learn how to fix the E: Failed to fetch http://{:url}{:package}.deb 404 Not Found [IP: {:ip} 80] error. If this article has helped you then please leave a comment :smiley:

Thanks for reading!