message_to_user "Dpkg, apt, and Pi-Apps will not work until you fix the conflicting repository.
Read the errors above, then look through /etc/apt/sources.list and /etc/apt/sources.list.d, making changes as necessary.
Perhaps doing a Google search for the exact error you received would help."
fi
#check for "Release file for <repo-url> is not valid yet"
if echo "$errors" | grep -q "Release file for .* is not valid yet" ;then
message_to_user "One or more repositories has a release file that becomes valid in the future.
Please look at the above errors to see how long you have to wait."
fi
#check for typo in sources.list and list.d
if echo "$errors" | grep -qF "The list of sources could not be read." ;then
message_to_user "One or more sources contain a typo. Before APT or Pi-Apps will work, you must look around in /etc/apt/sources.list and /etc/apt/sources.list.d and fix the typo."
fi
#check for "W: Did not understand pin type releace"
if echo "$errors" | grep -qF "Did not understand pin type" ;then
message_to_user "This error was not caused by Pi-Apps. Looks like there is a typo in your /etc/apt/sources.list"
fi
#------------------------------------------
#repo issues above, apt/dpkg issues below
#------------------------------------------
#check for "--fix-broken"
if echo "$errors" | grep -qF "\-\-fix\-broken" || echo "$errors" | grep -qF "needs to be reinstalled" ;then
message_to_user "APT reported a broken package, and you must fix it before Pi-Apps will work.
@ -93,13 +127,6 @@ Please run this command: sudo apt --fix-broken install"
Please run this command: sudo dpkg --configure -a"
message_to_user "Before dpkg, apt, or Pi-Apps will work, dphys-swapfile must be fixed.
Try Googling the above errors, or ask the Pi-Apps developers for help."
fi
#check for insufficient space errors
if echo "$errors" | grep -qF "You don't have enough free space in" ;then
message_to_user "Package(s) failed to install because your system has insufficient disk space.
@ -107,33 +134,6 @@ Try Googling the above errors, or ask the Pi-Apps developers for help."
Please free up some space, then try again."
fi
#check for unconfigured boot-firmware package
if echo "$errors" | grep -qF "missing /boot/firmware, did you forget to mount it" || echo "$errors" | grep -q "u-boot-rpi" ;then
message_to_user "Package(s) failed to install because your boot drive is not working.
You must fix the u-boot-rpi package before dpkg, apt, or Pi-Apps will work."
fi
#check for "Release file for http://httpredir.debian.org/debian/dists/buster-backports/InRelease is not valid yet"
if echo "$errors" | grep -q "Release file for .* is not valid yet" ;then
message_to_user "One or more repositories has a release file that becomes valid in the future.
Please look at the above errors to see how long you have to wait."
fi
#check for typo in sources.list and list.d
if echo "$errors" | grep -qF "The list of sources could not be read." ;then
message_to_user "One or more sources contain a typo. Before APT or Pi-Apps will work, you must look around in /etc/apt/sources.list and /etc/apt/sources.list.d and fix the typo."
fi
#check for "files list file for package 'package-name' is missing final newline"
if echo "$errors" | grep -q "files list file for package .* is missing final newline" ;then
message_to_user "Before dpkg, apt, or Pi-Apps will work, your system must be repaired.
Try Googling the above errors, or ask the Pi-Apps developers for help.
Perhaps this link will help: https://askubuntu.com/questions/909719/dpkg-unrecoverable-fatal-error-aborting-files-list-file-for-package-linux-ge"
fi
#check for "Command line option --allow-releaseinfo-change is not understood"
if echo "$errors" | grep -qF "Command line option --allow-releaseinfo-change is not understood" ;then
message_to_user "The Debian Project recently upgraded from Buster to version Bullseye. As a result, all Raspberry Pi OS Buster users will receive APT errors saying the repositories changed from 'stable' to 'oldstable'.
@ -146,13 +146,39 @@ Unfortunately for you, your operating system is too old for apt to understand th
Please flash your SD card with the latest release of Raspberry Pi OS: https://www.raspberrypi.org/software"
fi
#check for "installed package-name package post-installation script subprocess returned error exit status 10"
#------------------------------------------
#apt/dpkg issues above, package issues below
#------------------------------------------
#check for "installed <package-name> package post-installation script subprocess returned error exit status 10"
if echo "$errors" | grep -q "installed .* post-installation script subprocess returned error exit status 10" ;then
message_to_user "Some other package on your system is causing problems. As a result, dpkg and APT won't work properly.