pkg-install: add checks for bad raspberrypi-bootloader & libwine-development

pull/953/head
Botspot 4 years ago
parent 3e13dcb17d
commit 335dbbb8b3

@ -34,7 +34,7 @@ apt_diagnose() { #Explain stdin-inputted apt errors to user and list ways to fix
errors="$(cat /dev/stdin)" errors="$(cat /dev/stdin)"
#check for 'E: The repository' #check for 'E: The repository'
if echo "$errors" | grep -q 'E: The repository' || echo "$errors" | grep -q 'sources.list entry misspelt' ;then if echo "$errors" | grep -qF 'E: The repository' || echo "$errors" | grep -qF 'sources.list entry misspelt' ;then
message_to_user "APT reported a faulty repository, and you must fix it before Pi-Apps will work. message_to_user "APT reported a faulty repository, and you must fix it before Pi-Apps will work.
To delete the repository: To delete the repository:
@ -45,7 +45,7 @@ sources.list requires root permissions to edit: sudo mousepad /path/to/file"
fi fi
#check for 'NO_PUBKEY' #check for 'NO_PUBKEY'
if echo "$errors" | grep -q 'NO_PUBKEY';then if echo "$errors" | grep -qF 'NO_PUBKEY';then
echo -en "\e[93m echo -en "\e[93m
▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼
APT reported an unsigned repository. This script will try to repair it. APT reported an unsigned repository. This script will try to repair it.
@ -62,14 +62,14 @@ Waiting 10 seconds... Press Ctrl+C to cancel.\e[39m"
fi fi
# check for 'Could not resolve' or 'Failed to fetch' # check for 'Could not resolve' or 'Failed to fetch'
if echo "$errors" | grep -q 'Could not resolve' || echo "$errors" | grep -q 'Failed to fetch' || echo "$errors" | grep -q 'Temporary failure resolving' || echo "$errors" | grep -q 'Network is unreachable';then if echo "$errors" | grep -qF 'Could not resolve' || echo "$errors" | grep -qF 'Failed to fetch' || echo "$errors" | grep -qF 'Temporary failure resolving' || echo "$errors" | grep -qF 'Network is unreachable';then
message_to_user "APT reported an unresolvable repository. message_to_user "APT reported an unresolvable repository.
Please check your Internet connection and try again." Please check your Internet connection and try again."
fi fi
#check for 'is configured multiple times in' #check for 'is configured multiple times in'
if echo "$errors" | grep -q 'is configured multiple times in';then if echo "$errors" | grep -qF 'is configured multiple times in' ;then
message_to_user "APT reported a double-configured repository, and you must fix it to fix Pi-Apps. message_to_user "APT reported a double-configured repository, and you must fix it to fix Pi-Apps.
To delete the repository: To delete the repository:
@ -80,35 +80,35 @@ sources.list requires root permissions to edit: sudo mousepad /path/to/file"
fi fi
#check for "--fix-broken" #check for "--fix-broken"
if echo "$errors" | grep -q "\-\-fix\-broken" || echo "$errors" | grep -q "needs to be reinstalled" ;then 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. message_to_user "APT reported a broken package, and you must fix it before Pi-Apps will work.
Please run this command: sudo apt --fix-broken install" Please run this command: sudo apt --fix-broken install"
fi fi
#check for dpkg --configure -a #check for dpkg --configure -a
if echo "$errors" | grep -q "dpkg \-\-configure \-a" ;then if echo "$errors" | grep -qF "dpkg --configure -a" ;then
message_to_user "Before dpkg, apt, or Pi-Apps will work, dpkg needs to repair your system. message_to_user "Before dpkg, apt, or Pi-Apps will work, dpkg needs to repair your system.
Please run this command: sudo dpkg --configure -a" Please run this command: sudo dpkg --configure -a"
fi fi
#check for faulty dphys-swapfile package #check for faulty dphys-swapfile package
if echo "$errors" | grep -q "error processing package dphys-swapfile" ;then if echo "$errors" | grep -qF "error processing package dphys-swapfile" ;then
message_to_user "Before dpkg, apt, or Pi-Apps will work, dphys-swapfile must be fixed. 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." Try Googling the above errors, or ask the Pi-Apps developers for help."
fi fi
#check for insufficient space errors #check for insufficient space errors
if echo "$errors" | grep -q "You don't have enough free space in" ;then 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. message_to_user "Package(s) failed to install because your system has insufficient disk space.
Please free up some space, then try again." Please free up some space, then try again."
fi fi
#check for unconfigured boot-firmware package #check for unconfigured boot-firmware package
if echo "$errors" | grep -q "missing /boot/firmware, did you forget to mount it" || echo "$errors" | grep -q "u-boot-rpi" ;then 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. 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." You must fix the u-boot-rpi package before dpkg, apt, or Pi-Apps will work."
@ -122,7 +122,7 @@ Please look at the above errors to see how long you have to wait."
fi fi
#check for typo in sources.list and list.d #check for typo in sources.list and list.d
if echo "$errors" | grep -q "The list of sources could not be read." ;then 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." 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 fi
@ -135,7 +135,7 @@ Perhaps this link will help: https://askubuntu.com/questions/909719/dpkg-unrecov
fi fi
#check for "Command line option --allow-releaseinfo-change is not understood" #check for "Command line option --allow-releaseinfo-change is not understood"
if echo "$errors" | grep -q "Command line option --allow-releaseinfo-change is not understood" ;then 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'. 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'.
This error broke pi-apps. To fix it, the Pi-Apps developers added something to the 'sudo apt update' command: --allow-releaseinfo-change. This error broke pi-apps. To fix it, the Pi-Apps developers added something to the 'sudo apt update' command: --allow-releaseinfo-change.
@ -154,10 +154,19 @@ Perhaps reinstalling the package would help?"
fi fi
#check for "installed raspberrypi-kernel package post-installation script subprocess returned error exit status 1" #check for "installed raspberrypi-kernel package post-installation script subprocess returned error exit status 1"
if echo "$errors" | grep -q "installed raspberrypi-kernel package post-installation script subprocess returned error exit status 1" ;then if echo "$errors" | grep -qF "raspberrypi-kernel package post-installation script subprocess returned error exit status" ;then
message_to_user "The raspberrypi-kernel package on your system is causing problems. message_to_user "The raspberrypi-kernel package on your system is causing problems.
Pi-Apps, dpkg and APT won't work properly until the problem is fixed. Pi-Apps, dpkg and APT won't work properly until the problem is fixed.
Google the errors above this message, or ask in the Raspberry Pi Forums.
https://www.raspberrypi.org/forums"
fi
#check for "raspberrypi-bootloader package pre-installation script subprocess returned error exit status 2"
if echo "$errors" | grep -qF "raspberrypi-bootloader package pre-installation script subprocess returned error exit status" ;then
message_to_user "The raspberrypi-bootloader package on your system is causing problems.
Pi-Apps, dpkg and APT won't work properly until the problem is fixed.
Google the errors above this message, or ask in the Raspberry Pi Forums. Google the errors above this message, or ask in the Raspberry Pi Forums.
https://www.raspberrypi.org/forums" https://www.raspberrypi.org/forums"
fi fi
@ -170,6 +179,11 @@ Maybe reinstalling it would help?
sudo apt install --reinstall nginx-full" sudo apt install --reinstall nginx-full"
fi fi
#check for "installed libwine-development:arm64 package post-installation script subprocess returned error exit status 1"
if echo "$errors" | grep -qF "libwine-development:arm64 package post-installation script subprocess returned error exit status" ;then
message_to_user "This error was not caused by Pi-Apps, it is caused by your libwine-development package."
fi
#check for "W: Did not understand pin type releace" #check for "W: Did not understand pin type releace"
if echo "$errors" | grep -qF "Did not understand pin type" ;then 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" message_to_user "This error was not caused by Pi-Apps. Looks like there is a typo in your /etc/apt/sources.list"

Loading…
Cancel
Save