Full upgrade to the latest OS release automatically
🚀 One-linerLine to Run the Script from a URL Without Saving
Execute:
Replace <URL> with the actual raw script URL:
bash <(curl -fsSL <URL>)
✅ What This Script Does
This script checks your system and performs a full upgrade to the latest OS release automatically, including repository updates and cleanup.
🔧 Step-by-Step Breakdown:
- Check and install required utilities (
lsb-release) if missing. - Update the system package index (
apt update) and report if updates are available. - Upgrade current packages using
apt upgradein non-interactive mode. - Display current OS information (distro name, version, codename).
- Check if a newer OS release is available (e.g., Debian 13, Ubuntu 24).
-
If a newer release is available:
- Check if it's already in
/etc/apt/sources.list. - If not, update sources to point to the new release.
- Run
apt updateagain to refresh package index. - Perform a full system upgrade (
apt full-upgrade) non-interactively.
- Check if it's already in
- Remove old/unused packages using
apt autoremove. - Clean cached packages using
apt autocleanandapt clean. - Display final OS release information after upgrade is complete.
🛡️ The script is fully automated and handles all prompts silently — no user interaction required except for an optional reboot (not forced by the script).
Example:
bash <(curl -fsSL https://example.com/system_upgrade.sh)
Let me know if you want a reboot confirmation added at the end, or integration with cron/systemd!