Error: Unable to update package cache. Please try "sudo apt update"

Expected Behaviour:

I would expect it to update when using sudo apt upgrade and sudo apt update

Raspbian 64bit?

Raspberry Pi4

Actual Behaviour:

When it prompts for me to use sudo Apt Update this is what happens below.

Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:3 http://deb.debian.org/debian bookworm-updates InRelease
Ign:5 http://archive.raspbian.org/raspbian stretch InRelease
Hit:6 http://archive.raspberrypi.com/debian bookworm InRelease
Hit:4 https://dl.ui.com/unifi/debian stable InRelease
Err:7 http://archive.raspbian.org/raspbian stretch Release
  404  Not Found [IP: 93.93.128.191 80]
Reading package lists... Done
E: The repository 'http://archive.raspbian.org/raspbian stretch Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Debug Token: https://tricorder.pi-hole.net/KqOvAUXY/

I'm not sure what I'm doing wrong and hopefully I provided the debug token correctly.

Any help would be appreciated, thank you!

Your OS is sourcing packages from Debian 12/Bookworm and Raspbian 9/Stretch.
Stretch is EOL since 2020, and ist LTS support was discontinued about 3 years ago in July 2022.

If you tried an in-place upgrade of Raspbian Stretch to Bookworm, then you now have a mixture of Debian and Raspberry Pi OS.
Note that the Raspberry Pi Foundation discourages in-place upgrades, recommending to upgrade to a new release by installing it on a new SD card and swap that out for the old one instead, see Upgrade your operating system to a new major version.

I'd recommend to take a teleporter backup with Pi-hole, follow the Raspberry Pi Foundation's recommendation and write a new image to another SD card, install Pi-hole and import your teleporter backup.

Great, thanks! I'll format the SD card and perform a clean install.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.