29.1. Planning the System Lifecycle
A lifecycle plan answers four practical questions: which release the host runs and for how long it will receive fixes, what the host actually contains, whether the next release should be reached by upgrading or by replacing the machine, and how much downtime and data loss the service can tolerate. The Debian Project supplies the first answer; the other three come from local records and from tests performed before the maintenance window.
29.1.1. Stable Releases, Point Releases, Security Support, and LTS
Debian publishes a new stable release approximately every two years. The release is named after a Toy Story character and carries a numeric version: Debian 12 is bookworm, Debian 13 is trixie. After release, the stable suite receives point releases, usually every two months. A point release is not a new distribution; it is an updated set of installer images and package indexes that incorporates the security and bug fixes already published for that release. Upgrading within a point release is an ordinary package upgrade, not a distribution upgrade.
The support life has several phases. Full support covers security updates, important bug fixes, and installer and release-team work. When a newer stable release appears, the previous one becomes oldstable, and after its full-support window ends, security work continues through the Debian Long Term Support (LTS) team for a further period. After LTS, Extended Long Term Support (ELTS) is available from commercial providers for organizations that need to keep an old release alive longer. The dates are published at https://www.debian.org/releases/ and should be checked again whenever a maintenance plan is reviewed.
| Release | Code name | Released | End of full support | End of LTS | End of ELTS |
|---|---|---|---|---|---|
| Debian 13 | trixie | 2025-08-09 | 2028-08-09 | 2030-06-30 | 2035-06-30 |
| Debian 12 | bookworm | 2023-06-10 | 2026-07-11 | 2028-06-30 | 2033-06-30 |
Do not describe Debian 12 as unsupported merely because Debian 13 is stable.
Debian 12 became oldstable when Debian 13 was released; after July 2026 its
security work continues under LTS until mid-2028. The distinction matters for
planning: the archive layout does not change at the LTS boundary - the same
bookworm and bookworm-security source entries keep working - but the LTS
team maintains a defined package set rather than the whole archive. The
debian-security-support package ships check-support-status, which lists
installed packages that fall outside the set covered by the current support
phase; run it when a release approaches the LTS transition. ELTS, by contrast,
is a commercial service with its own repository and its own source entries.
Figure 29.2. Published support windows for the two releases discussed in this chapter. The boundaries are approximate to the month; the authoritative dates and any later extensions are on the Debian releases page. Full support, LTS, and ELTS overlap in responsibility but not in archive contents.
The practical consequence is a deadline, not a date on which work begins. A host that runs Debian 12 in 2026 should already have a tested path to Debian 13, because the upgrade competes with the end of full support, the expiry of a certificate, and the next hardware failure. A useful lifecycle record contains the release, its full-support end date, the LTS end date, the responsible team, and the planned replacement or upgrade window.
29.1.2. Inventorying Packages, Services, Repositories, and Dependencies
An upgrade plan is only as good as the inventory behind it. Start with the release and the package set. On life1, as john:
$ cat /etc/debian_version
13.5
The file reports the point release, not the code name. The code name and the
configured archives come from APT policy. The following command prints the
package files and their priorities; the sed keeps the first 24 lines, which
on this host is the whole listing.
$ apt-cache policy | sed -n '1,24p'
Package files:
100 /var/lib/dpkg/status
release a=now
100 https://deb.debian.org/debian trixie-backports/main amd64 Packages
release o=Debian Backports,a=stable-backports,n=trixie-backports,l=Debian Backports,c=main,b=amd64
origin deb.debian.org
500 https://deb.debian.org/debian trixie-updates/main amd64 Packages
release v=13-updates,o=Debian,a=stable-updates,n=trixie-updates,l=Debian,c=main,b=amd64
origin deb.debian.org
500 https://security.debian.org/debian-security trixie-security/main amd64 Packages
release v=13,o=Debian,a=stable-security,n=trixie-security,l=Debian-Security,c=main,b=amd64
origin security.debian.org
500 https://deb.debian.org/debian trixie/main amd64 Packages
release v=13.8,o=Debian,a=stable,n=trixie,l=Debian,c=main,b=amd64
origin deb.debian.org
Pinned packages:
The trixie and trixie-security entries identify the stable and security
archives; the v=13.8 field describes the archive's current point release,
while the installed system still reports 13.5 - that difference is exactly the
pending upgrade set. The backports archive has priority 100, so a package is not
taken from it unless it is requested explicitly, a pin raises its priority, or
it is the only candidate. A source line that names bookworm on a Debian 12
host would appear here in the same position; that is the line to change during
a release upgrade.
Count the installed packages and look for services that are actually running:
$ dpkg-query -W -f='${Package}\n' | wc -l
440
The count is a baseline, not a target. A sudden change of dozens of packages
after an upgrade is normal when library transitions replace packages; a change
of hundreds on a host that should be stable deserves investigation.
dpkg-query reads the package database and prints one package name per line;
the pipeline counts those lines, and the single quotes protect the ${Package}
format string from the shell.
$ systemctl list-units --type=service --state=running --no-pager | head -8
UNIT LOAD ACTIVE SUB DESCRIPTION
chrony.service loaded active running chrony, an NTP client/server
cron.service loaded active running Regular background program processing daemon
dbus.service loaded active running D-Bus System Message Bus
getty@tty1.service loaded active running Getty on tty1
nginx.service loaded active running A high performance web server and a reverse proxy server
rsyslog.service loaded active running System Logging Service
ssh.service loaded active running OpenBSD Secure Shell server
The list is shortened to the first eight running services. Record the full
list, not only the visible head: a service that matters may be enabled but
currently stopped, and an upgrade can start it if a package changes its preset.
systemctl list-unit-files --state=enabled shows the boot-time selection;
Chapter 8 explains the difference between enabled,
active, and running.
Listening sockets show what the host exposes independently of the unit names. The following command requires root privileges because it includes process owners:
$ sudo ss -lntup | head -12
Netid State Recv-Q Send-Q Local Address:Port Peer Address:PortProcess
udp UNCONN 0 0 0.0.0.0:68 0.0.0.0:* users:(("dhclient",pid=495,fd=7))
udp UNCONN 0 0 127.0.0.1:323 0.0.0.0:* users:(("chronyd",pid=497,fd=5))
udp UNCONN 0 0 [::1]:323 [::]:* users:(("chronyd",pid=497,fd=6))
tcp LISTEN 0 511 0.0.0.0:8080 0.0.0.0:* users:(("nginx",pid=14778,fd=7),("nginx",pid=14777,fd=7))
tcp LISTEN 0 511 0.0.0.0:80 0.0.0.0:* users:(("nginx",pid=14778,fd=5),("nginx",pid=14777,fd=5))
tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=800,fd=6))
tcp LISTEN 0 511 [::]:80 [::]:* users:(("nginx",pid=14778,fd=6),("nginx",pid=14777,fd=6))
tcp LISTEN 0 128 [::]:22 [::]:* users:(("sshd",pid=800,fd=7))
The options are -l for listening sockets, -n for numeric ports, -t and
-u for TCP and UDP, and -p for the owning process. Port 8080 is the legacy
service that will be replaced; port 22 must remain reachable. Port 80 is the
default nginx site and is not the service under maintenance. Recording the
process owner matters because a port number alone does not identify the unit
that owns it.
Holds and pins are part of the inventory because they can silently block an upgrade:
$ apt-mark showhold
No output means no package is held. An empty result is normal; a nonempty result should be matched against the reason for the hold. During a release upgrade, a hold on a library or a core package may leave the system half-transitioned. Remove holds that are no longer justified and record why any remaining hold is retained.
Capacity belongs in the same inventory, because a release upgrade needs room for a new package set. Check both block space and inode space:
$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 98G 2.0G 91G 3% /
Inodes are a separate limit:
$ df -i /
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/vda1 6553600 85970 6467630 2% /
Finally, inspect the upgrade plan without changing anything. apt-get -s
simulates the operation and prints the same dependency calculation that the real
command would use; the grep selects the summary line from it:
$ apt-get -s dist-upgrade | grep -E '^[0-9]+ upgraded,'
69 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
The pipeline's first stage is the simulation; the second keeps only the line
that counts the planned changes. On this host, 69 packages have newer versions
in the archive and one new package would be installed - the new kernel that
Section 29.2.2 installs. A release upgrade is larger still: the simulated
summary for changing from bookworm to trixie is the number to compare
against the free-space estimate in Section 29.2.4. If the simulation reports
removals, read the package list before going further; an upgrade plan that
removes a service package is a decision, not a detail.
The commands used with apt-get in this chapter have these common effects:
| Option | Description |
|---|---|
update |
Refresh package indexes from the configured sources. |
upgrade |
Install available upgrades without removing packages or installing new ones. |
upgrade --without-new-pkgs |
Upgrade what can be upgraded while keeping the old dependency set; the first stage of a release upgrade. |
full-upgrade |
Upgrade and allow new packages or removals when dependencies require them. |
dist-upgrade |
Historical synonym for full-upgrade; older documentation uses this name. |
-s, --simulate |
Print the operation without changing the system. |
-y, --assume-yes |
Answer confirmation prompts automatically; appropriate for reviewed automation, not for an interactive upgrade. |
--purge autoremove |
Remove automatically installed packages that are no longer needed and purge their configuration. |
-f install |
Correct a dependency state that is already broken. |
-o DPkg::Lock::Timeout=300 |
Wait up to five minutes for the dpkg lock instead of failing immediately. |
The last option is useful on a host with unattended upgrades, but it does not replace a maintenance window. Disabling automatic upgrades during a release upgrade prevents two package managers from changing the same database.
29.1.3. Choosing In-Place Upgrade or Replacement
There are two normal ways to move a service to a new Debian release. An in-place upgrade changes the packages on the existing root filesystem. A replacement builds a new system, deploys the service from configuration, and moves data and traffic to it. A rebuild on the same hardware, or a reinstall that preserves only data, is a variant of replacement. The choice is not about which method is more modern; it is about which method has a tested recovery path for this service.
| Criterion | In-place upgrade | Replacement or parallel rebuild |
|---|---|---|
| Preserves installed state | Keeps locally modified packages, users, and configuration unless changed by the upgrade | Starts from a known base; local state must be declared or migrated explicitly |
| Downtime | Usually one reboot plus service validation | Can be near zero if the old host keeps serving while the new one is tested |
| Rollback | Requires a snapshot, VM revert, or restore; package downgrade alone is not a rollback | Old host remains available until cutover; rollback is a traffic change |
| Hardware refresh | Not addressed | Natural opportunity to replace failing or undersized hardware |
| Configuration drift | Carried forward and must be reviewed | Removed if configuration is versioned and deployed from code |
| Disk and time cost | Lower; one root filesystem and one package download | Higher; a second system, address, certificate, and test cycle |
| Best fit | A host whose installed state is difficult to reproduce, with a proven snapshot or restore | A service defined by packages, configuration, and data, especially one already managed by Ansible, Puppet, or similar tools |
The decision flow below makes the dependencies explicit. The first question is not "which upgrade is faster" but "can the workload be rebuilt from versioned configuration?" If it can, a parallel replacement often gives a better rollback story than an in-place upgrade. If it cannot, the in-place path is appropriate only when the data is separable and the restore procedure has been exercised.
Figure 29.3. Choosing an upgrade path. A restore drill and a clone upgrade test convert uncertainty into evidence before the maintenance window. The old host stays available in the parallel path, so rollback is a traffic decision rather than a package operation.
An in-place upgrade is not automatically cheaper. It requires free space for the new packages and the old ones until configuration is complete, a working boot loader, a console or out-of-band path, and a backup that can be restored without the host being upgraded. A replacement requires a second address, a certificate strategy, a data synchronization method, and a cutover plan. Both require the application compatibility test in Section 29.2.5. The mistake is to choose one path and discover its recovery requirements during the outage.
29.1.4. Maintenance Windows, Service Continuity, and Recovery Objectives
A maintenance window is a commitment about when work may interrupt service. It is useful only when paired with a definition of acceptable interruption. Two numbers make that definition concrete. The recovery time objective (RTO) is the maximum acceptable time to restore service after a failure. The recovery point objective (RPO) is the maximum acceptable amount of data loss, usually expressed as a time interval. A service with an RPO of fifteen minutes needs backups or replication at least that often; a nightly archive does not meet it, regardless of how carefully the archive is checksummed.
Write the window and the objectives into the recovery record before the upgrade. A practical record covers:
| Item | Example for the lifecycle service |
|---|---|
| Service and owner | nginx lifecycle site on TCP 8080 and 8443, operations team |
| Maintenance window | Saturday 02:00–05:00 UTC, change freeze lifted after validation |
| RTO | 90 minutes from decision to roll back |
| RPO | 24 hours for records; 1 hour for configuration changes under version control |
| Continuity method | life1 keeps serving until life2 passes HTTP, TLS, and data checks |
| Rollback method | revert the load-balancer or DNS target to life1; restore data from the last verified archive |
| Communication | status page at start, cutover, validation, and close |
| Evidence required | checksum, restore test, failed-unit check, application test, backup timer check |
Service continuity is usually a traffic problem rather than a package problem. Put the old and new hosts behind a load balancer, a reverse proxy, or a DNS record with a short TTL, and test the switch in both directions. If clients cache the old address for a day, a DNS change does not provide a fast rollback. If the service holds sessions in local memory, a second host needs shared session storage or sticky routing; otherwise "high availability" becomes a source of user-visible errors.
The maintenance window should reserve time for the boring recovery path. A release upgrade that finishes early still needs a reboot, a login test, a service test, a backup run, and a check that monitoring is receiving data. A window that ends when the package command returns is not a maintenance window; it is a hope. The sequence used in this chapter keeps those checks explicit:
Figure 29.4. The release upgrade sequence. Inventory and recovery evidence come before any source change; validation and repository re-enablement come after the reboot. A failure at any stage returns to the recovery record rather than continuing blindly.