Package, service and boot failures
Quick answer
Investigate the failed layer before attempting recovery: package dependency resolution, unit configuration, runtime readiness or boot initialization.
Write down the last successful stage and first observed failure. An installed package, valid unit and running process are different milestones. Fix the earliest demonstrated failure in a disposable environment and repeat the end-to-end health check.
Prepare the practice environment
Run python3 lab-fixtures/troubleshooting/setup.py from the extracted root as an ordinary user. Enter the printed fresh private path and check pwd. Use fresh fixtures, Bash with set -e -o pipefail, LC_ALL=C and umask 077. Run each snippet in a separate Bash process, not your interactive shell. Only private files are used; optional examples require an authorized snapshot VM. Do not change live services, mounts, policies or resource limits. All supplied records are fictional; no host incident records are collected. Review the lab guide.
Prerequisites
Review: Disk full and open deleted files.
How it works
For Debian-family package conflicts, inspect apt-cache policy PACKAGE and apt-mark showhold, then use apt-get -s install PACKAGE in an authorized VM to preview changes. A candidate version is not necessarily installable. Review proposed removals and repository consistency; never blindly force dependencies. For systemd failures, inspect systemctl status UNIT and journalctl -b -u UNIT, then systemctl cat UNIT and systemd-analyze verify on a private copy. A valid unit can fail at runtime because of missing files, identity, permissions or dependencies. An invalid ExecStart path differs from an application exit code. Boot failure requires console access, the previous boot journal if retained, and inspection of root-device and mount configuration. Use an approved previous kernel or VM snapshot when appropriate, not arbitrary bootloader edits. Restore the known-good config and verify both unit syntax and service readiness, recording the rollback point; keep change records and preflight checks. The sample logs are invented for practice.
Try the examples
Compare available versions, pinning and holds. Do not assume that a forced install is safe.
Expected stdout:
report-app : Depends: report-lib (= 2.0) but 1.0 is selectedThis simulated systemd status points to failure to execute the process; investigate the executable, interpreter and permissions.
Expected stdout:
report.service: status=203/EXECOffline systemd-analyze verify checks a private unit with a nonexistent executable and a corrected copy. It never starts a service.
Expected stdout:
invalid executable rejected; corrected unit verifiedCommon mistakes
Never use force flags, reboot or reinstall as the first response. Syntax verification does not establish runtime readiness.
Practice
Identify the dependency mismatch and EXEC failure, run the offline unit verification, then write a VM-only recovery plan with console access, known-good configuration and readiness check.
Related references
Study: systemctl, journalctl, apt-cache. These are reference names, not deployed links.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Package, service and boot failures — Knowledge Check
Apply troubleshooting concepts to synthetic fixtures and VM-only scenarios.
What should be inspected before forcing package resolution?
What does systemd status 203/EXEC suggest?
What does offline unit verification establish?
What is appropriate before boot recovery?