13 Debian upgrade of virtual machine
hugopoi edited this page 2026-11-19 17:32:12 +01:00

Debian upgrade of virtual machine

Generic procedure

  1. purge config files, coming from previous upgrades : find /etc \( -name '*.dpkg-*' -o -name '*.ucf-*' -o -name '*.merge-error' \)
    • fix those manually, or delete them all at once by adding option "-delete"
  2. apply any upgrades to the current release : apt update && apt full-upgrade && apt clean
  3. adapt the sources.list files with the new distribution (sed -i 's/bookworm/trixie/g' /etc/apt/sources.list{,.d/*} for example)
  4. etckeeper commit "Prepare APT for ${DIST?}"
  5. First, upgrade 'apt' itself : apt update && apt install -y apt && apt update
  6. download all packages : apt full-upgrade -d
  7. Make sure to use open a screen session
  8. to reduce downtime, make progressive upgrades :
    • start with systemd : apt install --upgrade systemd
    • then sensible packages : services you want the minimal downtime (eg. bind9, nginx, etc.) : apt install --upgrade bind9, etc.
  9. if everything is OK apt full-upgrade (or better, to avoid debconf questions or needrestart questions : NEEDRESTART_SUSPEND=y DEBIAN_FRONTEND=noninteractive apt -o DPKG::Options::="--force-confold" full-upgrade -y)
  10. check config files and manually merge as needed *.dpkg-* et *.ucf-* : find /etc \( -name '*.dpkg-*' -o -name '*.ucf-*' \)
  11. purge any removed package with residual config: apt autopurge ~c
  12. And then, let's do some housekeeping...: apt autopurge

In order to have config files as similar as possible with those from the distribution, use vim -d ma_conf ma_conf.dpkg- new

]c :        - next difference\\
[c :        - previous difference\\
do          - diff obtain\\
dp          - diff put\\
zo          - open folded text\\
zc          - close folded text\\
:diffupdate - re-scan the files for differences

Upgrade notes for vm-limbo

Upgrade to Debian 12.0 Bookworm

The guide to upgrade to update to 12.0 Bookworm https://www.debian.org/releases/bookworm/amd64/release-notes/ch-upgrading.en.html I follow ALL the steps in the guide

  1. Create a snapshot of /dev/raid5ssd/limbo documentation guide-demenagement-vm
  2. Edit /etc/apt/sources.list and use http://archive.debian.org ( seems security isn't available anymore -> make sens )
  3. apt update
  4. apt full-upgrade
  5. reboot
  6. clean all obsolete package apt list ~o, manually kept concierge apt list '~o' | cut -d '/' -f 1 | grep -v concierge | tr '\n' ' ' and apt purge ...
  7. Clean all old dpkg-old files
  8. Clean all old kernels apt autoremove linux-image-xxxxxx
  9. script --log-timing ~/upgrade-bookworm.time -a ~/upgrade-bookworm.script
  10. apt upgrade --without-new-pkgs
  11. apt full-upgrade
  12. reboot
  13. cleanup unused kernels
  14. apt autoremove
  15. after inspecting obsolete packages we need to migrate Postgresql to 15 I followed this guide https://stanislas.blog/2025/03/postgres-major-upgrade/
    • Checking databases sudo --user=postgres psql --port=5432 --list and sudo --user=postgres psql --port=5433 --list
    • pg-15 was automatically installed during upgrade but not used
    • backup sudo -Hiu postgres pg_dump ejabberd | gzip > ejabberd_pg_dump_2026-10-04.tar.gz
  16. export package_to_purge=$(apt list '~o' | grep -vP "milter-greylist|concierge" | cut -d "/" -f 1 -s - | tr '\n' ' ')
  17. Resolve the snapshot

Upgrade to Debian 13.0 Trixie

  1. Upgrade OpenSSH to at least 1:9.2p1-2+deb12u7 indicated in https://www.debian.org/releases/trixie/release-notes/issues.en.html#interrupted-remote-upgrades
  2. I followed the guide https://www.debian.org/releases/trixie/release-notes/upgrading.en.html
  3. The PG migration was handle directly in the apt upgrade ( no extra step )