Chapter 29. Release Upgrades and Lifecycle Maintenance
A Debian installation is not finished on the day it boots. It acquires a release identity, a support horizon, a set of third-party sources, local accounts, certificates, backups, and a reason to exist. Those facts change at different rates. Package updates arrive weekly, point releases a few times a year, a new stable release roughly every two years, and hardware or an application contract may force a replacement before either. Lifecycle maintenance is the work of keeping those clocks aligned: knowing what the host contains, preparing an upgrade before it is urgent, carrying the upgrade through without losing access, proving that services and data survived, knowing how to recover when they did not, and finally retiring the host without leaving credentials or data behind.
This chapter follows one managed server from inventory through a release upgrade, a failed package transition, a replacement deployment, and decommissioning. The examples use two Debian 13 systems:
| Role | Host | Isolated link | Responsibility |
|---|---|---|---|
| Upgrade host, control node, backup source, provisioning server | life1 | 192.168.229.10/24 | nginx legacy service on port 8080, Ansible control, DHCP/TFTP/PXE artifacts |
| Managed host and replacement | life2 | 192.168.229.20/24 | Ansible-managed nginx on ports 8080 and 8443, node exporter, backup and check timers |
Both hosts keep a second interface on a management network, 192.168.121.0/24, which carries SSH and package downloads. The addresses are local examples; substitute your own. Section 29.7 brings the two roles together in the replacement exercise. Building virtual machines and attaching an isolated network are covered in Chapter 24; the examples assume the network topology from Section 24.3.3.
Figure 29.1. The lifecycle practice hosts. life1 holds the old service, the configuration repository, and the provisioning services; life2 is managed by Ansible and becomes the replacement. Management SSH and package downloads use a separate network so that no lab address change can remove administrative access.
The lab starts at Debian 13.5 and brings it to the current 13.8 point release during the chapter; the Debian 12 side of the release upgrade starts at 12.15 in a separate root filesystem. The captures come from apt 3.0.4, dpkg 1.22.22, debootstrap 1.0.141, ansible-core 2.19.11, nginx-light 1.26.3-3+deb13u11, openssh-server 1:10.0p1-7+deb13u4, prometheus-node-exporter 1.9.0, isc-dhcp-server 4.4.3-P1, tftpd-hpa 5.2+20240610-3, and pxelinux 3:6.04~git20190206.bf6db5b4+dfsg1-3.1. Versions on your systems will differ, especially after a point release.
Commands entered in john's ordinary shell begin with $; commands entered in a
root shell begin with #. The prompt marker is not typed. A single elevated
command from john's shell is written $ sudo command. In this chapter's lab,
john's sudo policy is passwordless, which keeps the captured commands short; a
password prompt is the normal case on a production host, and every sudo command
shown works identically when sudo asks for one. A root shell is entered with
sudo -i and left with exit. Example files and the recovery record live
under ~/debian-handbook/lifecycle, which expands to
/home/john/debian-handbook/lifecycle in john's shell. Root's ~ is a
different directory, so privileged commands spell the path out. Each console
block shows one complete command followed by its own output; shortened output
is labeled "Selected output" or marked with an omission note.
The package operations below had confirmation supplied by the recording harness so that a noninteractive transcript would not stall; on an ordinary terminal, apt and dpkg ask before downloading and changing packages, and you answer those prompts yourself. The same harness runs debconf without a controlling terminal, so the captures omit the resulting "unable to initialize frontend" warnings; a real terminal uses the dialog frontend and shows the configuration questions instead.
Create the workspace before the first inventory:
$ mkdir -p ~/debian-handbook/lifecycle
The command prints nothing when the directory is created or already exists.
The chapter uses that directory for package fixtures, Ansible code, the backup
manifest, and the recovery record; system paths such as /etc, /srv, and
/var/lib remain where Debian expects them.