diff --git a/pkg-install b/pkg-install index cb8cfc4..e152fe4 100755 --- a/pkg-install +++ b/pkg-install @@ -34,7 +34,7 @@ apt_diagnose() { #Explain stdin-inputted apt errors to user and list ways to fix errors="$(cat /dev/stdin)" #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. To delete the repository: @@ -45,7 +45,7 @@ sources.list requires root permissions to edit: sudo mousepad /path/to/file" fi #check for 'NO_PUBKEY' - if echo "$errors" | grep -q 'NO_PUBKEY';then + if echo "$errors" | grep -qF 'NO_PUBKEY';then echo -en "\e[93m ▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼▼ 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 # 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. Please check your Internet connection and try again." fi #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. To delete the repository: @@ -80,35 +80,35 @@ sources.list requires root permissions to edit: sudo mousepad /path/to/file" fi #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. Please run this command: sudo apt --fix-broken install" fi #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. Please run this command: sudo dpkg --configure -a" fi #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. Try Googling the above errors, or ask the Pi-Apps developers for help." fi #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. Please free up some space, then try again." fi #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. 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 #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." fi @@ -135,7 +135,7 @@ Perhaps this link will help: https://askubuntu.com/questions/909719/dpkg-unrecov fi #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'. 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 #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. 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. https://www.raspberrypi.org/forums" fi @@ -170,6 +179,11 @@ Maybe reinstalling it would help? sudo apt install --reinstall nginx-full" 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" 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"