Upgrading Debian 9 ("Stretch") to Debian 10 ("Buster")

Category: Debian
Created: 2020-08-17
Updated: 2024-09-20

As of Debian 8, upgrading a Debian installation to the next major version number works quite smoothly. Depending on the speed of the server and the duration of the reboot, an upgrade is usually completed in under 15 minutes.

Follow the steps below to upgrade:

  1. update /etc/apt/sources.list (replace stretch with buster)
  2. if necessary, update the file /etc/apt/sources.list.d/liveconfig.list for the LiveConfig PHP repository in the same way
  3. run apt update
  4. run apt install apt dpkg
  5. run apt upgrade
  6. run apt full-upgrade. While running, you will be asked whether some existing configuration files should be replaced - in most cases it is better to keep the existing configuration (answer with no).
  7. run apt-get autoremove to remove all packages that are no longer required
  8. reboot the server (that’s important to switch the kernel and all kernel modules)
  9. then log in to LiveConfig as admin and go to Server ManagementE-Mail. Save the configuration for Postfix and for Dovecot again (this will update the configuration files and adapt them for Debian Buster).

Possible problems

  • MariaDB gets updated from version 10.1.48 to 10.3.39. This changes the default SQL_MODE:

    • before: NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    • after: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

    The new option STRICT_TRANS_TABLES can lead to errors in some (mostly old) applications. To retain the “old” SQL_MODE, create a file /etc/mysql/mariadb.conf.d/99-sql-mode.cnf with the following content:

    [mariadb]
    sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    

    Then restart MariaDB (systemctl restart mariadb).

If you have any other issues, please let us know so we can update this article accordingly.

Additionally you may have a look at the possible problems while upgrading Debian 8 to 9.

New in Debian 10

Some things have changed with Debian Buster (see What’s new in the Buster release?). The major changes are:

  • When changing to root user by using the su command, the PATH variable will not be altered any more to contain /sbin and /usr/sbin! The workarounds are:
    • use su - instead (add a dash), this launches a new login shell
    • configure and use sudo (like on Ubuntu ;-)
    • put ALWAYS_SET_PATH yes in /etc/login.defs to get the “old” behaviour back
  • On fresh installations, the contents of /bin, /sbin and /lib* will be installed in their /usr counterpart by default. /bin, /sbin and /lib* will be soft-links pointing to /usr/... - see Debian manual.