A, interactive Bash script for safely updating Ubuntu systems. It handles apt, snap, flatpak, journal cleanup, and firmware updatesβcomplete with dry-run mode, colored output, reboot detection, and modular skip flags.
- APT package updates:
update,upgrade,dist-upgrade,clean,autoremove - Snap and Flatpak update support
- Firmware updates via
fwupdmgr - Journal log cleanup
- Reboot detection (and optional automatic reboot)
- Dry-run mode for safe command previewing
- Colored, readable terminal output
- Intelligent cleanup of old Snap and unused Flatpak packages
- Detection of held packages
sudo ./ubuntu-update.sh [options]| Short | Long | Description |
|---|---|---|
-u |
--skip-update |
Skip apt-get update |
-g |
--skip-upgrade |
Skip apt-get upgrade |
-d |
--skip-dist-upgrade |
Skip apt-get dist-upgrade |
-f |
--skip-flatpak |
Skip Flatpak updates |
-c |
--skip-clean |
Skip apt-get clean |
-r |
--skip-autoremove |
Skip apt-get autoremove |
-j |
--skip-journal |
Skip journal cleanup |
-n |
--dry-run |
Preview commands without executing |
-y |
--yes |
Automatically reboot if required |
-h |
--help |
Show help message |
This script must be run as root. Use sudo:
sudo ./ubuntu-update.shUpdate everything and reboot automatically if needed:
sudo ./ubuntu-update.sh --yesRun a dry-run to preview all actions:
sudo ./ubuntu-update.sh --dry-runSkip Flatpak and journal cleanup:
sudo ./ubuntu-update.sh --skip-flatpak --skip-journalaptsnap(optional)flatpak(optional)fwupdmgr(optional)getoptjournalctl
Make sure these are installed if you want full functionality.
- APT:
clean,autoremove - Snap: old disabled revisions
- Flatpak: unused apps
- Journal: logs older than 7 days
- Detects if
/run/reboot-requiredor firmware updates require a reboot - Prompts user unless
--yesis passed
The script temporarily stores update logs in /tmp, showing key messages (warning, error, critical, etc.) at the end.
Feel free to open issues or submit pull requests to improve the script!