Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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`

Expand Down
9 changes: 6 additions & 3 deletions checkforupdates.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/bash
set -e

# Check if running with sudo privileges
if [[ $EUID -ne 0 ]]; then
Expand All @@ -22,15 +21,19 @@ 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

# 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
Expand Down