Skip to content

AngelFreak/ubuntu-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Ubuntu Update Script

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.

πŸ›  Features

  • 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

πŸš€ Usage

sudo ./ubuntu-update.sh [options]

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

πŸ” Permissions

This script must be run as root. Use sudo:

sudo ./ubuntu-update.sh

πŸ“ Example Commands

Update everything and reboot automatically if needed:

sudo ./ubuntu-update.sh --yes

Run a dry-run to preview all actions:

sudo ./ubuntu-update.sh --dry-run

Skip Flatpak and journal cleanup:

sudo ./ubuntu-update.sh --skip-flatpak --skip-journal

πŸ“¦ Dependencies

  • apt
  • snap (optional)
  • flatpak (optional)
  • fwupdmgr (optional)
  • getopt
  • journalctl

Make sure these are installed if you want full functionality.

🧹 Cleanup Actions

  • APT: clean, autoremove
  • Snap: old disabled revisions
  • Flatpak: unused apps
  • Journal: logs older than 7 days

πŸ”„ Reboot Handling

  • Detects if /run/reboot-required or firmware updates require a reboot
  • Prompts user unless --yes is passed

πŸ“ Logging

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!

About

Updates Ubuntu .deb, snap, flatpak, and firmware

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages