From 1dc2bb3aaca2e4905e061a613570ae8afe12df2b Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Thu, 2 May 2024 15:25:45 -0400 Subject: [PATCH] `api`: add check for inconsistent apt downgrade information --- api | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api b/api index 8c41c4ad79..d32a17e4bf 100755 --- a/api +++ b/api @@ -2182,6 +2182,13 @@ sudo apt --fix-broken install -o Dpkg::Options::='--force-overwrite'") error_type="system" fi fi + + # Downgrade errors with no actual packages listed as to be downgraded. Assume users (custom) distro is to blame. + if grep -q "E: Packages were downgraded and -y was used without --allow-downgrades." <<<"$errors" && ! grep -q "The following packages will be DOWNGRADED:" <<<"$errors" ;then + error_caption+=("Apt is reporting conflicting information that packages would be downgraded as a result of this standard apt install yet no packages are listed as to be downgraded. +This is likely an issue with your linux distribution. Please contact the appropriate maintainer for assistance.") + error_type="system" + fi #if RPi OS, check for /etc/apt/sources.list.d/raspi.list if [ -f /etc/rpi-issue ] && ( [ ! -f /etc/apt/sources.list.d/raspi.list ] || ! grep -q "^deb http://archive.raspberrypi.org/debian\|^deb https://archive.raspberrypi.org/debian\|^deb http://archive.raspberrypi.com/debian\|^deb https://archive.raspberrypi.com/debian" /etc/apt/sources.list.d/raspi.list ) ;then