Shared server guidance · Question & answer

How do I investigate an interrupted Debian or Ubuntu package installation?

An interrupted transaction can leave packages unpacked but not configured, or dependencies unresolved. Start by checking package state and available disk space. Repair may execute package scripts and restart services, so review the affected packages rather than treating every package error as a harmless cache problem.

AdvancedDebian/Ubuntu servers using dpkg and APT
Go to the answer

Before you start

  • An authorised SSH session on the Linux server.

Instructions

1. Audit the package database

Run the audit after confirming that no package manager is still working. It reports incomplete package states without attempting to repair them.

Remote Linux shell
sudo dpkg --audit
df -h / /var

Record the exact affected packages and whether the relevant filesystem has room to finish configuration.

2. Preview dependency repair

Use a simulated APT repair to see the proposed dependency solution. This can reveal an unwanted removal or an incompatible repository before any change is committed.

Remote Linux shell
apt-get -s -f install

The -f option asks APT to resolve broken dependencies, while -s keeps this invocation a simulation. Review all proposed actions.

3. Choose the documented repair path

If a single package only needs configuration, an administrator can configure that verified package by name. If dependencies need repair, approve the reviewed transaction and follow the distribution’s recovery guidance; do not combine unrelated upgrades into the incident.

Check the result

  • A subsequent dpkg --audit is clean, package checks succeed, and the affected application’s service and user-facing behaviour are verified.

Troubleshooting

The proposed repair removes application components
Stop and resolve version or repository conflicts before proceeding.
A maintainer script repeatedly fails
Investigate its reported error, permissions and dependencies. Re-running the same repair without addressing the cause is unlikely to help.

Official references

Use the documentation for your installed version when a flag, service name or platform feature differs.