How to upgrade from Debian 11 to Debian 12

update from Debian 11 to Debian 12: please note that major release updates are prone to problems. for the savest way to upgrade: keep data sepearte from programs and reinstall.

on the other hand already upgraded 3 Debian 11 to Debian 12 and all managed to boot up and decrypt their root harddisk (this is THE major heart attack moment X-D)

  1. MAKE SURE TO HAVE A FULL BACKUP OF THE SYSTEM OR AT LEAST THE IMPORTANT DATA! (which SHOULD BE IN THE USER’S /HOME FOLDER)
  2. MAKE SURE THERE IS ENOUGH (AT LEAST 10GB) OF FREE DISK SPACE ON THE root harddisk partition (usually /dev/sda1)
  3. (it really is not that bad, the old config should just work fine after the upgrade but stil… BACKUP ALL CONFIG FILES! :D)
  4. cp -rv /etc/ssh/sshd_config /etc/ssh/sshd_config.backup
    cp -rv /etc/apache2/apache2.conf /etc/apache2/apache2.conf.backup
    cp -rv /etc/apache2/conf-available/security.conf /etc/apache2/conf-available/security.conf.backup
    cp -rv /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf.backup
    cp -rv /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-available/default-ssl.conf.backup
    
  5. Update from Debian 11 to Debian 12:
  6. if all goes well, the user is now booting Debian 12 with this kernel:
    • uname -a
      Linux hostname 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.38-2 (2023-07-27) x86_64 GNU/Linux
  7. update-migrate from php7.4 to php8.2

Apache2 upgrade problems not running PHP(8.2) but output text of code

it seems this is a problem, because php7.4 config files are still installed

and libapache2-mod-php8.2 does not get installed automatically

lsb_release -d; # tested on
Description: Debian GNU/Linux 12 (bookworm)

# install new version of php for apache2
apt install libapache2-mod-php8.2

dpkg -l|grep php
rc  libapache2-mod-php7.4           7.4.33-1+deb11u4                        amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  libapache2-mod-php8.2           8.2.7-1~deb12u1                         amd64        server-side, HTML-embedded scripting language (Apache 2 module)
ii  php-common                      2:93                                    all          Common files for PHP packages
ii  php-db                          1.11.0-0.2                              all          Database Abstraction Layer
ii  php-imagick                     3.7.0-4                                 amd64        Provides a wrapper to the ImageMagick library
ii  php-memcache                    8.0+4.0.5.2+3.0.9~20170802.e702b5f9+-8  amd64        memcache extension module for PHP
ii  php-mysql                       2:8.2+93                                all          MySQL module for PHP [default]
ii  php-pear                        1:1.10.13+submodules+notgz+2022032202-2 all          PEAR Base System
ii  php-xml                         2:8.2+93                                all          DOM, SimpleXML, WDDX, XML, and XSL module for PHP [default]
rc  php7.4-cli                      7.4.33-1+deb11u4                        amd64        command-line interpreter for the PHP scripting language
rc  php7.4-common                   7.4.33-1+deb11u4                        amd64        documentation, examples and common module for PHP
rc  php7.4-curl                     7.4.33-1+deb11u4                        amd64        CURL module for PHP
rc  php7.4-gd                       7.4.33-1+deb11u4                        amd64        GD module for PHP
rc  php7.4-intl                     7.4.33-1+deb11u4                        amd64        Internationalisation module for PHP
rc  php7.4-json                     7.4.33-1+deb11u4                        amd64        JSON module for PHP
rc  php7.4-mbstring                 7.4.33-1+deb11u4                        amd64        MBSTRING module for PHP
rc  php7.4-mysql                    7.4.33-1+deb11u4                        amd64        MySQL module for PHP
rc  php7.4-opcache                  7.4.33-1+deb11u4                        amd64        Zend OpCache module for PHP
rc  php7.4-pspell                   7.4.33-1+deb11u4                        amd64        pspell module for PHP
rc  php7.4-readline                 7.4.33-1+deb11u4                        amd64        readline module for PHP
rc  php7.4-sqlite3                  7.4.33-1+deb11u4                        amd64        SQLite3 module for PHP
rc  php7.4-tidy                     7.4.33-1+deb11u4                        amd64        tidy module for PHP
rc  php7.4-xml                      7.4.33-1+deb11u4                        amd64        DOM, SimpleXML, XML, and XSL module for PHP
rc  php7.4-xmlrpc                   7.4.33-1+deb11u4                        amd64        XMLRPC-EPI module for PHP
rc  php7.4-zip                      7.4.33-1+deb11u4                        amd64        Zip module for PHP
ii  php8.2-cli                      8.2.7-1~deb12u1                         amd64        command-line interpreter for the PHP scripting language
ii  php8.2-common                   8.2.7-1~deb12u1                         amd64        documentation, examples and common module for PHP
ii  php8.2-imagick                  3.7.0-4                                 amd64        Provides a wrapper to the ImageMagick library
ii  php8.2-memcache                 8.0+4.0.5.2+3.0.9~20170802.e702b5f9+-8  amd64        memcache extension module for PHP
ii  php8.2-mysql                    8.2.7-1~deb12u1                         amd64        MySQL module for PHP
ii  php8.2-opcache                  8.2.7-1~deb12u1                         amd64        Zend OpCache module for PHP
ii  php8.2-phpdbg                   8.2.7-1~deb12u1                         amd64        server-side, HTML-embedded scripting language (PHPDBG binary)
ii  php8.2-readline                 8.2.7-1~deb12u1                         amd64        readline module for PHP
ii  php8.2-xml                      8.2.7-1~deb12u1                         amd64        DOM, SimpleXML, XML, and XSL module for PHP

# can also try
a2dismod php7.4
a2enmod php8.2

# remove the old php7.4 INCLUDING the config files
apt --purge remove php7*

# restart apache
systemctl restart apache2

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin