Update DietPi from v7.4.2 to v7.8.2 keeps failing

#### Details:
- Date           | Thu Nov 18 13:32:06 CET 2021
- DietPi version | v7.4.2 (MichaIng/master)
- Image creator  | DietPi Core Team
- Pre-image      | Raspbian Lite
- Hardware       | RPi 3 Model B (armv7l) (ID=3)
- Kernel version | `Linux dietpi.manzili.mez 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux`
- Distro         | stretch (ID=4,RASPBIAN=1)
- Command        | `apt-get -o Acquire::AllowReleaseInfoChange::Suite=true -q update`
- Exit code      | 100
- Software title | DietPi-Pre-patches
#### Steps to reproduce:
<!-- Explain how to reproduce the issue -->
1. ...
2. ...
#### Expected behaviour:
<!-- What SHOULD happen? -->
- ...
#### Actual behaviour:
<!-- What IS happening? -->
- ...
#### Extra details:
<!-- Please post any extra details that might help solve the issue -->
- ...
#### Additional logs:

Hit:3 https://archive.raspberrypi.org/debian stretch InRelease
Ign:1 https://packages.ntop.org/apt/stretch_pi armhf/ InRelease
Get:5 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
Ign:2 https://packages.ntop.org/apt/stretch_pi all/ InRelease
Err:4 https://packages.ntop.org/apt/stretch_pi armhf/ Release
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Get:7 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]
Err:6 https://packages.ntop.org/apt/stretch_pi all/ Release
server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
Reading package lists…
E: The repository ‘http://apt.ntop.org/stretch_pi armhf/ Release’ does no longer have a Release file.
E: The repository ‘http://apt.ntop.org/stretch_pi all/ Release’ does no longer have a Release file.


I never faced any issues with my Raspberry PI and DeitPi setup. I use it simply as DHCP + DNS servers with Pi-Hole, noip, and some custom services I wrote to track connection status. However, since the release of v7.8.2 I tried to update with no success. I went through this forum to see if there are people facing the same issue with no luck. I tried to follow all the suggested solutions related to updating or upgrading here and in GitHub issues as well as similar errors reported by users of other operating systems in other architectures and nothing worked.

As the last line indicates, this repository no longer has a release file but I tried to switch to another and can't figure out what may work. I will appreciate any help from this community to fix this issue.

the reason is your outdated Debian version as you are still running Stretch. This is causing more and more issues as you see.

To fix your issue, you would need to switch HTTPS to HTTP for the ntop.org source file. Have a look to /etc/apt/sources.list.d/. There should be a file related to ntop.org, open the file and change to HTTP. Afterwards run apt update && apt upgrade

I saw this solution, and I tried it out. I didn’t work. The log attached to this post is after I switched HTTP. I get the same error with HTTPS or HTTP.

the error you posted is still using https

Err:4 https://packages.ntop.org/apt/stretch_pi armhf/ Release

pls ensure you have changed all files related and try again. pls post the output of apt update. As well try to avoid screen prints. Better to copy the output from SSH terminal directly.

The result of running apt update is:

dietpi@dietpi:~$ sudo apt update
Hit:1 https://archive.raspberrypi.org/debian stretch InRelease                 
Hit:4 http://raspbian.raspberrypi.org/raspbian stretch InRelease               
Err:2 https://packages.ntop.org/apt/stretch_pi armhf/ InRelease
  Could not resolve host: packages.ntop.org
Err:3 https://packages.ntop.org/apt/stretch_pi all/ InRelease
  Could not resolve host: packages.ntop.org
Reading package lists... Done
Building dependency tree       
Reading state information... Done
43 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: Failed to fetch http://apt.ntop.org/stretch_pi/armhf/InRelease  Could not resolve host: packages.ntop.org
W: Failed to fetch http://apt.ntop.org/stretch_pi/all/InRelease  Could not resolve host: packages.ntop.org
W: Some index files failed to download. They have been ignored, or old ones used instead.

The results of searching for HTTPS in the /etc/apt folder are:

dietpi@dietpi:~$ grep -rnw '/etc/apt/' -e 'https'
/etc/apt/apt.conf.d/97dietpi:2:# Docs: https://manpages.debian.org/apt.conf
/etc/apt/sources.list.d/raspi.list:1:deb https://archive.raspberrypi.org/debian/ stretch main ui

The results of searching for ntop in the same folder are:

Binary file /etc/apt/trusted.gpg matches
/etc/apt/sources.list.d/ntop.list:1:deb http://apt.ntop.org/stretch_pi armhf/
/etc/apt/sources.list.d/ntop.list:2:deb http://apt.ntop.org/stretch_pi all/
Binary file /etc/apt/trusted.gpg~ matches

Try to reboot. Due to whatever reason your system is still trying to use HTTPS on the ntop package

Some repositories have a forced HTTP => HTTPS redirection, so changing the request protocol there doesn’t have any effect. But the issue isn’t HTTPS but resolving the hostname, isn’t it?

Err:2 > https://packages.ntop.org/apt/stretch_pi > armhf/ InRelease
Could not resolve host: packages.ntop.org
Err:3 > https://packages.ntop.org/apt/stretch_pi > all/ InRelease
Could not resolve host: packages.ntop.org

The hostname exists, but the RPi Stretch suite doesn’t seem to exist anymore: According to Index of /apt it should be http://apt.ntop.org/stretch_pi, but that does not exist, also https://packages.ntop.org/stretch_pi/ does not. It looks like all available repositories are here: Index of /debian
As you can see it contains buster_pi and a Debian Stretch suite, but no RPi Stretch suite.

If you need to use this, upgrade your system to Buster, which should be pretty painless: Usage hints / HowTo - DietPi.com Docs

Update the list file first:

echo -e 'deb https://apt.ntop.org/buster_pi/ all/\ndeb https://apt.ntop.org/buster_pi/ armhf/' > /etc/apt/sources.list.d/ntop.list

It is a strange ancient repository format :thinking:.

MichaIng
on the initial report it was certificate issue

Err:4 https://packages.ntop.org/apt/stretch_pi armhf/ Release
  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

Now I am getting this I trying to switch to buster this came when I executed apt update I did also apt install ca-certificates since some people faced the same issue in Ubuntu and fixed it this way.

Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 https://archive.raspberrypi.org/debian buster InRelease
Ign:3 https://apt.ntop.org/buster_pi armhf/ InRelease
Ign:4 https://apt.ntop.org/buster_pi all/ InRelease
Ign:5 https://apt.ntop.org/buster_pi armhf/ Release
Ign:6 https://apt.ntop.org/buster_pi all/ Release
Ign:7 https://apt.ntop.org/buster_pi armhf/ Packages
Ign:8 https://apt.ntop.org/buster_pi all/ Packages
Ign:7 https://apt.ntop.org/buster_pi armhf/ Packages
Ign:8 https://apt.ntop.org/buster_pi all/ Packages
Ign:7 https://apt.ntop.org/buster_pi armhf/ Packages
Ign:8 https://apt.ntop.org/buster_pi all/ Packages
Ign:7 https://apt.ntop.org/buster_pi armhf/ Packages
Ign:8 https://apt.ntop.org/buster_pi all/ Packages
Ign:7 https://apt.ntop.org/buster_pi armhf/ Packages
Ign:8 https://apt.ntop.org/buster_pi all/ Packages
Err:7 https://apt.ntop.org/buster_pi armhf/ Packages
  SSL: certificate subject name (mail.ntop.org) does not match target host name 'apt.ntop.org'
Err:8 https://apt.ntop.org/buster_pi all/ Packages
  SSL: certificate subject name (mail.ntop.org) does not match target host name 'apt.ntop.org'
Reading package lists... Done
E: Failed to fetch https://apt.ntop.org/buster_pi/armhf/Packages  SSL: certificate subject name (mail.ntop.org) does not match target host name 'apt.ntop.org'
E: Failed to fetch https://apt.ntop.org/buster_pi/all/Packages  SSL: certificate subject name (mail.ntop.org) does not match target host name 'apt.ntop.org'
E: Some index files failed to download. They have been ignored, or old ones used instead.

might it be better to disable ntop source list first, update to buster and enable ntop source again later on. But not sure if this is a good idea :smiley:

Indeed:

rm /etc/apt/sources.list.d/ntop.list
apt update

And if you want to update it:

cd /tmp
curl -fLo ntopng.deb 'https://packages.ntop.org/debian/buster_pi/armhf/ntopng/ntopng_5.1.211114-15936_armhf.deb'
dpkg -i ntopng.deb
rm ntopng.deb

Find the latest Raspberry Pi Buster packages here: https://packages.ntop.org/debian/buster_pi/armhf/ntopng/