29.4. Validating and Completing the Upgrade

The package command returning zero is the beginning of validation, not the end. Check the unit state, the journal, mounts, routes, name resolution, application behavior, timers, and backups. Then remove obsolete packages, review local configuration, and re-enable only the external repositories that are compatible with the new release.

29.4.1. Checking Failed Units, Logs, Network Access, and Mounts

On life1, as john, ask systemd for failed units:

$ systemctl --failed --no-pager
  UNIT LOAD ACTIVE SUB DESCRIPTION

0 loaded units listed.

The header is printed even when the list is empty; 0 loaded units listed is the result to record. A failed unit is not always a new failure. Compare the list with the pre-upgrade inventory, and read the unit's journal before restarting it. A unit that failed because a dependency is still starting may recover on its own; a unit that failed because its configuration format changed needs a decision.

Mounts are next because a release upgrade can change the mount unit generator's view of /etc/fstab:

$ sudo findmnt --verify
   [W] your fstab has been modified, but systemd still uses the old version;
       use 'systemctl daemon-reload' to reload

0 parse errors, 0 errors, 1 warning

The warning is about systemd's cached view, not a malformed line. The summary reports zero parse errors and zero verification errors, so the file is syntactically valid. Run systemctl daemon-reload after editing /etc/fstab or a mount unit, then repeat the verification. A nonzero parse-error count means a line is malformed; a verification error may mean a missing device, an unreachable network mount, or a duplicate mount point. The options used here are:

Option Description
--verify Check /etc/fstab and mount unit files for syntax and consistency errors.
--fstab Read the mount table from /etc/fstab instead of the running kernel.
--target Verify the mounts needed for a specific target.
--verbose Show more detail about each checked entry.

The route table should still contain a default route and the management link:

$ ip route
default via 192.168.121.1 dev eth0
192.168.121.0/24 dev eth0 proto kernel scope link src 192.168.121.133
192.168.229.0/24 dev eth1 proto kernel scope link src 192.168.229.10

The isolated link is present and has the expected address. A missing default route after a reboot usually means the network configuration was not applied; Chapter 17 covers interface configuration and routing. Test the peer on the isolated link specifically, because a management network failure and a lab network failure have different causes:

$ ping -c1 -W2 192.168.229.20
PING 192.168.229.20 (192.168.229.20) 56(84) bytes of data.
64 bytes from 192.168.229.20: icmp_seq=1 ttl=64 time=0.985 ms

--- 192.168.229.20 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.985/0.985/0.985/0.000 ms

-c1 sends a single probe and -W2 waits at most two seconds for the answer, so the command returns quickly in both directions. A single successful ping proves that the link and the peer's ICMP path work; it does not prove that the service on the peer is healthy. Use ss on the peer and an application request for that. The journal completes the picture: journalctl -b -p err --no-pager prints error-priority messages from the current boot. Read the unit-specific journal for each service that matters, for example journalctl -u nginx --since today; Chapter 8 covers priority filters, boot selection, and persistent journal storage.

29.4.2. Testing Applications, Scheduled Jobs, and Backup Runs

Test the service through the same path a client uses. On life1, as john, request the legacy page:

$ curl -fsS http://127.0.0.1:8080/
<!doctype html>
<html lang="en">
<head><meta charset="utf-8"><title>Legacy lifecycle service</title></head>
<body>
<h1>Legacy lifecycle service release 1.0</h1>
<p>This host is scheduled for replacement.</p>
</body>
</html>

The legacy page still answers after the point-release upgrade, which is the application-level confirmation that the kernel switch and the library updates did not break the service. The replacement deployed in Section 29.7 is tested the same way over HTTP and TLS in Section 29.7.4.

Scheduled jobs are part of the application. On the upgraded host, list its timers with systemctl list-timers and confirm that each timer's NEXT value is in the future and that its ACTIVATES service is the one you expect; the captured timer listing in Section 29.7.2 shows the format. A timer with an empty NEXT is not scheduled - check its OnCalendar expression with systemctl cat and systemd-analyze calendar; Chapter 10 explains the calendar syntax.

Backup runs are tested by exercising the backup path and reading its evidence. Re-run the oneshot service from Section 29.2.4 with sudo systemctl start lifecycle-backup.service, confirm from its status that it ended Deactivated successfully, and compare the new manifest against the previous one - the archive content should differ only in its timestamp. The managed service in Section 29.7 automates this pattern: its backup timer runs nightly, its check service verifies the evidence every five minutes, and its metrics expose the completion time so that monitoring can alert on a backup that stopped happening.

29.4.3. Reviewing Obsolete Packages and Local Configuration Changes

After the upgrade, remove packages that are no longer needed only after reviewing the list. In the upgraded chroot, in a root shell:

# chroot /srv/upgrade-lab/rootfs apt-get --purge autoremove
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

A 0 to remove result is common when the package set is minimal. On a desktop or a long-lived server, the same command may propose a long list of old kernels, old library packages, and packages that were installed as dependencies and are no longer required. Read the list; do not confirm automatically. A package that is "no longer required" by APT may still be required by a local script, a manually installed application, or a service that was configured outside the package system. Chapter 6 explains apt-mark manual and the autoremove state. On a full host, the command runs without the chroot wrapper and reviews the same states.

Obsolete packages are not the same as residual configuration. After a package is removed without purging, its conffiles may remain in the rc state (removed but not purged). List them with dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' filtered for lines whose status begins with rc. If the list contains a package that will be reinstalled or whose configuration you need, leave it alone. Purging a package removes its conffiles and cannot be undone without a backup. For a package that will never return, sudo apt-get purge package is the normal cleanup.

Local configuration changes are the other half of the review. A conffile prompt may have kept an old file that no longer matches the new package's expectations, or a package may have added a new configuration directory that the old local file does not include. Compare the package's shipped configuration with the local file using dpkg-query -L package to find the shipped path and diff -u to compare. debsums -c checks installed files against the package checksums, but it reports intentional local modifications as differences, so use it to find unexpected changes rather than to declare every difference a problem. The package documentation and the release notes name the configuration changes that matter.

29.4.4. Re-Enabling Compatible External Repositories

A third-party repository is re-enabled only after its packages are known to be compatible with the new release and its signing key is still trusted. For the practice repository, move the source file back - on life1, as john:

$ sudo mv /etc/apt/sources.list.d/handbook.list.disabled /etc/apt/sources.list.d/handbook.list

The move is silent. Refresh the indexes:

$ sudo apt-get update
Get:1 file:/srv/handbook-repo ./ InRelease [1741 B]
Get:1 file:/srv/handbook-repo ./ InRelease [1741 B]
Hit:2 https://deb.debian.org/debian trixie InRelease
Hit:3 https://deb.debian.org/debian trixie-updates InRelease
Hit:4 https://deb.debian.org/debian trixie-backports InRelease
Get:5 file:/srv/handbook-repo ./ Packages [932 B]
Hit:6 https://security.debian.org/debian-security trixie-security InRelease
Reading package lists...

The duplicate Get:1 line is how the file: transport reports the same InRelease file twice; it is not two repositories. APT validates the signature against the signed-by keyring before using the index. Confirm the candidate before upgrading:

$ apt-cache policy handbook-agent
handbook-agent:
  Installed: 1.0
  Candidate: 2.0
  Version table:
     2.0 500
        500 file:/srv/handbook-repo ./ Packages
 *** 1.0 500
        500 file:/srv/handbook-repo ./ Packages
        100 /var/lib/dpkg/status

Both versions have archive priority 500; the installed version is selected until an explicit upgrade is requested. Upgrade only the package, not the whole system:

$ sudo apt-get install --only-upgrade handbook-agent
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be upgraded:
  handbook-agent
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1020 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 file:/srv/handbook-repo ./ handbook-agent 2.0 [1020 B]
apt-listchanges: Reading changelogs...
Unpacking handbook-agent (2.0) over (1.0) ...
Setting up handbook-agent (2.0) ...

Selected output; the database-progress lines are omitted. The package's own version command confirms the change:

$ handbook-agent
handbook-agent 2.0

--only-upgrade prevents apt from installing a package that is not already present. It does not prevent dependency changes, so read the summary. If the third-party repository also publishes dependencies that conflict with Debian's packages, isolate it with a pin or a separate repository and review it as Chapter 6 describes. A repository that is compatible with Debian 13 today can become incompatible at its next release; re-check it at every point release, not only at the distribution upgrade.