Skip to main content

Debian Full upgrade to the latest OS release automatically

๐Ÿš€ One-Line Execute:

Replace <URL>ย with the actual raw script URL:

apt update && apt install -y curl && clear && curl -s https://docs.greenhome.stream/attachments/41 | bash

โœ… 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:
  1. Check and install required utilities (lsb-release) if missing.
  2. Update the system package index (apt update) and report if updates are available.
  3. Upgrade current packages using apt upgrade in non-interactive mode.
  4. Display current OS information (distro name, version, codename).
  5. Check if a newer OS release is available (e.g., Debian 13, Ubuntu 24).
  6. 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 update again to refresh package index.
    • Perform a full system upgrade (apt full-upgrade) non-interactively.
  7. Remove old/unused packages using apt autoremove.
  8. Clean cached packages using apt autoclean and apt clean.
  9. 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).