How To Upgrade Debian to a New Release

Check Debian Version on Debian website:
https://www.debian.org/releases/
Check version on system:

$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

Or

$ sudo cat /etc/os-release

USERS SHOULD BACKUP ALL DATA before attempting a release upgrade – SEE https://wiki.debian.org/DebianStability

Only after the back – do the following:

Ensure your system is up-to-date in it’s current release.

$ sudo apt update
$ sudo apt upgrade

If you haven’t already, ensure all backups are up-to-date.

Make a backup of the /etc/apt/sources.list file:

$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

In a text editor, replace the codename of your release with that of the next release in APT’s package sources
For instance, the line:

deb https://deb.debian.org/debian/ buster main

should be replaced with

deb https://deb.debian.org/debian/ bullseye main
$ sudo nano /etc/apt/sources.list 

# Clean and update package lists

$ sudo apt clean
$ sudo apt update

Perform the major release upgrade, removing packages if required

$ sudo apt full-upgrade

Remove packages that are not required anymore. Be sure to review this list: you may want to keep some of them

$ sudo apt autoremove

Reboot to make changes effective (optional, but recommended)

$ sudo shutdown -r now

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.