Debian apt-get update 404 not found error

aptdebianlinuxraspberry pi

My Raspberry Pi 3 is having problems. When I try to run apt-get update, I get a 404 not found error. I am very new to Linux and I am not sure what is wrong.

Here is the error code:

pi@raspberrypi:~ $ sudo apt-get update
Ign http://mirrordirector.raspbian.org jessie InRelease
Ign http://archive.raspbian.org jessie InRelease
Hit http://archive.raspberrypi.org jessie InRelease                            
Ign http://archive.raspbian.org jessie Release.gpg                             
--*cut*--

W: Failed to fetch http://mirrordirector.raspbian.org/raspbian/dists/jessie/rpi/binary-armhf/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.
pi@raspberrypi:~ $ 

My /etc/apt/sources.list file looks like this:

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

My /etc/apt/sources.list.d/raspi.list file looks like this:

deb http://archive.raspberrypi.org/debian/ jessie main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://archive.raspberrypi.org/debian/ jessie main ui

Please help. I can provide more information if necessary.

Note: Chromium, ping (from bash shell) is working.

Note: The sites that were not able to be fetched are not reachable from another computer using the same WiFi, (nor on the Raspberry Pi 3) e.g. http://mirrordirector.raspbian.org/raspbian/dists/jessie/non-free/binary-armhf/Packages gives a 404 Not Found Error.

https://superuser.com/a/1133746/1498871 has something about a EOL Debian version. Is this my problem?

I have tried a few of the Super User posts on this topic, but none of the solutions that I have tried have worked.

Raspbian GNU/Linux 8.0 (jessie) is the descriptor line from lsb_release -a.

Best Answer

Your version of Debian was obsoleted in 2017 or thereabouts. The Raspberry Pi Foundation doesn't support it anymore.

The simplest way is to start with the latest Raspberry Pi OS, reapply whatever changes you've made (I have a fairly simple set of instructions on serverfault on how I'd do it) and work from there.

Alternatively you could try upgrading the distro, but on single board computers, there's occasionally strangeness that you won't find on x86es, and it depends on the repos still being available.

If you have anything important on the SD card/install please back it up.

Then things get interesting. The 'previous' version of Raspbian is "Stretch". The current one is "Buster", the next one "Bullseye" is about to be released soon - you have Jessie.

In theory, if the repos are still up, you can modify your /etc/apt/sources.list and *.list files in /etc/apt/sources.list.d and replace jessie with stretch, do an apt update then an apt full-upgrade, then do it again, replacing stretch with buster (and soon in another step buster with bullseye) - doing it for one version is mentioned in the docs but jumping multiple versions isn't something I've seen people do - do it in steps. On the bright side, if things fail you have a backup and can work from there.

Related Question