diff --git a/README.md b/README.md index 52b36e8..601b3ea 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ Automated system update and maintenance script. Performs package updates, cleanu - Flatpak package upgrade (if installed) **Features:** -- Error handling: stops on first error +- Error handling: non-critical operations (Snap/Flatpak) continue on failure with a warning - Privilege verification: ensures it's run with sudo - Detailed status messages - Safe dependency removal with multiple safeguards @@ -164,7 +164,7 @@ sudo checkforupdates - Install required packages: `sudo apt install lshw dmidecode` **`checkforupdates` exits early:** -- The script uses error handling and stops on first error +- Snap/Flatpak failures are non-fatal; check the warning output for details - Check the output for which command failed - Review system logs if needed: `journalctl -xe` diff --git a/checkforupdates.sh b/checkforupdates.sh index 21da030..152ba9e 100644 --- a/checkforupdates.sh +++ b/checkforupdates.sh @@ -1,5 +1,4 @@ #!/usr/bin/bash -set -e # Check if running with sudo privileges if [[ $EUID -ne 0 ]]; then @@ -22,7 +21,9 @@ apt autoremove --yes # Check for Snap if command -v snap &> /dev/null; then echo "Refreshing Snap packages..." - snap refresh --stable + if ! snap refresh; then + echo "Warning: Snap refresh encountered errors, continuing..." + fi else echo "Snap is not installed." fi @@ -30,7 +31,9 @@ fi # Check for Flatpak if command -v flatpak &> /dev/null; then echo "Refreshing Flatpak packages..." - flatpak upgrade --assumeyes + if ! flatpak upgrade --assumeyes; then + echo "Warning: Flatpak upgrade encountered errors, continuing..." + fi else echo "Flatpak is not installed." fi