Skip to content

Instantly share code, notes, and snippets.

@Neilblaze
Created August 28, 2024 14:36
Show Gist options
  • Save Neilblaze/4b66dc128300492df8b56bbcba047e32 to your computer and use it in GitHub Desktop.
Save Neilblaze/4b66dc128300492df8b56bbcba047e32 to your computer and use it in GitHub Desktop.
Ubuntu 20.04 LTS to 22.04 LTS (for R-Pi 4B)

Here's a step-by-step procedure to upgrade your Raspberry Pi 4B from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS:

  1. Update your current system:

    sudo apt update
    sudo apt upgrade -y
    sudo apt dist-upgrade -y
    sudo apt autoremove -y
    
  2. Install the update-manager-core package if it's not already installed:

    sudo apt install update-manager-core
    
  3. Edit the release-upgrades configuration file:

    sudo nano /etc/update-manager/release-upgrades
    

    Change the "Prompt" line to:

    Prompt=lts
    

    Save and exit the file (Ctrl+X, then Y, then Enter).

  4. Start the upgrade process:

    sudo do-release-upgrade
    
  5. Follow the on-screen prompts. The upgrade process will:

    • Download new packages
    • Install the upgrades
    • Remove obsolete packages
    • Handle any configuration file changes
  6. When prompted, agree to restart services during the upgrade.

  7. If asked about keeping or replacing configuration files, review the changes and decide accordingly.

  8. The upgrade will take some time. Once it's complete, you'll be prompted to reboot. Enter 'y' to reboot.

  9. After rebooting, log in and verify the upgrade:

    lsb_release -a
    

    This should show Ubuntu 22.04 LTS.

  10. Update and upgrade again to ensure all packages are up-to-date:

    sudo apt update
    sudo apt upgrade -y
    

Important notes:

  • Ensure your Raspberry Pi is connected to a stable power source throughout the upgrade.
  • Back up important data before starting the upgrade process.
  • The upgrade may take several hours, depending on your internet speed and the Pi's performance.
  • If you encounter any issues, you may need to troubleshoot or consider a fresh install of Ubuntu 22.04 LTS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment