Debian OS Upgrade

This page shows how to update Debian 10 Buster to Debian 11 Bullseye using command-line options, including upgrading all installed packages.

  • Step 1. Backup your system
    sudo cp -v /etc/apt/sources.list /root/
    sudo cp -rv /etc/apt/sources.list.d/ /root/
    sudo cp -rv /etc/nginx/ /root/
  • Step 2. Update ALL existing installed packages
    lsb_release -a
    uname -mrs
    sudo apt update && sudo apt upgrade -y
    sudo apt full-upgrade
    sudo apt --purge autoremove
    sudo reboot
  • Step 3. Update /etc/apt/sources.list file
    cat /etc/apt/sources.list
    # main 
    deb http://deb.debian.org/debian/ buster main
    deb-src http://deb.debian.org/debian/ buster main
    
    deb http://security.debian.org buster-security main
    deb-src http://security.debian.org buster-security main
    
    # non-free
    #deb http://deb.debian.org/debian stable main contrib non-free
    
    # buster-updates, previously known as 'volatile'
    deb http://deb.debian.org/debian/ buster-updates main
    deb-src http://deb.debian.org/debian/ buster-updates main
    # Replace buster with bullseye
    sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list
    sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list.d/*
    
    # Updating the package list
    sudo apt update
  • Step 4. Minimal system upgrade
    sudo apt upgrade
    Restart services during package upgrades without asking: YES
    Keep the local version currently installed: YES/OK
  • Step 5. Upgrading Debain 10 to Debian 11
    sudo apt full-upgrade
    sudo reboot
  • Step 6. Verification
    sudo apt install lsb-release
    lsb_release -a
    uname -r
    # Sample outputs:
    
    No LSB modules are available.
    Distributor ID:	Debian
    Description:	Debian GNU/Linux 11 (bullseye)
    Release:	11
    Codename:	bullseye
    # Finally, clean up outdated packages 
    sudo apt --purge autoremove
    sudo apt autoclean