Upgrading distribution versions is one of the most frustruating jobs, expecially when there’s no GUI interface that can upgrade everything with just a click of button. But once you start being a professional personnal working in the industry, you need to learn how to upgrade from one version of a distribution to the latest one so as to keep the system secure.

In this blog, I will be going through, how you can upgrade Debian to the latest stable version.

Currently I was having Debian 9(Stretch), which I installed a long time ago. I use Debian with i3WM and it’s the lightest OS I came across after Arch linux. Later I discovered that the distribution version that I was running was outdated and it’s time for an upgrade. Hence I decided to do so.

OS Version Name Support
Debian 9 Stretch Old Stable
Debian 10 Buster Current Stable

Find about the versions from Debian’s official release page

Updating package manager and repositories

  • Firstly, backup a copy of the sources.list

        $ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
    
  • Change the keywords ‘stretch’ to ‘buster’ in the sources.list file

    To know more, visit Distro page

    It may look like this after changing

      deb http://deb.debian.org/debian  buster main
      deb-src http://deb.debian.org/debian/ buster main
    
      deb http://security.debian.org/debian-security buster/updates main
      deb-src http://security.debian.org/debian-security buster/updates main
    
      deb http://deb.debian.org/debian buster-updates main
      deb http://deb.debian.org/debian buster/updates main
    
  • Save the file with su privilage

  • Update the local package list

        $ sudo apt-get update
    
  • Upgrade the software packages to the latest distro version

        $ sudo apt-get upgrade
    
  • Finally, run the distro upgrade command

        $ sudo apt-get dist-upgrade
    
  • To confirm that you are running the latest version, run the command

        $ hostnamectl
    

Hope you were able to upgrade to the latest version of Debian.