How to fix dpkg: error processing package linux-image-X.X.X-generic (--configure): installed linux-image-X.X.X-generic package post-installation script subprocess returned error exit status 1 in APT

APTINTERMEDIATEHIGHUpdated Oct 17, 2026ยท 716 views

The dpkg post-installation script for linux-image failed with exit status 1, typically due to a full /boot partition, incompatible kernel modules, or corrupted package metadata. This can be fixed by freeing space, removing old kernels, or reconfiguring dpkg.

Quick fix

Fixes 1

df -h /boot
  1. Check available space in the /boot partition
  2. Remove old kernel images to free space
  3. Reconfigure all partially-installed packages
  4. Fix broken dependencies if dpkg still fails
apt โ€” error
df -h /boot
dpkg: error processing package linux-image-X.X.X-generic (--configure): installed linux-image-X.X.X-generic package post-installation script subprocess returned error exit status 1

What this error means

When you install or update a Linux kernel on Debian-based systems (Ubuntu, Linux Mint, Debian), the linux-image package includes a post-installation script that sets up the kernel, generates initramfs images, and installs DKMS modules. If this script fails with exit status 1, it means the kernel installation process encountered an error that prevented it from completing successfully. The most common cause is insufficient space in the /boot partition, but it can also result from incompatible or missing kernel modules (DKMS modules like wireguard or displaylink), corrupted package metadata, or interrupted installations.

Typical symptoms

  • Running `apt update` or `apt install` fails with the dpkg error message
  • Kernel updates are blocked and cannot proceed
  • System shows partially-installed packages that won't complete
  • The /boot partition is critically low on free space (less than 50 MB)
  • DKMS modules fail during kernel installation with error messages

Common causes

  1. The /boot partition is full or nearly full, leaving no space for kernel images or initramfs files
  2. One or more DKMS modules (third-party kernel modules) are incompatible with the kernel version being installed
  3. The dpkg package database is corrupted or in an inconsistent state from a previous failed installation
  4. A previous kernel installation was interrupted (power loss, cancelled update) leaving the system in a half-configured state
  5. Missing or incompatible kernel module packages that the post-installation script depends on

How to fix "dpkg: error processing package linux-image-X.X.X-generic (--configure): installed linux-image-X.X.X-generic package post-installation script subprocess returned error exit status 1"

1Check available space in the /boot partition

First, verify whether you have sufficient space in your /boot directory. A full /boot partition is the most common cause of this error.

bash
df -h /boot

If the output shows less than 100 MB free, proceed to step 2 to remove old kernels. If you have adequate space, skip to step 3.

2Remove old kernel images to free space

List all installed kernels on your system:

bash
dpkg --list | grep linux-image

Identify old kernel versions you no longer need (usually keep only the 2 most recent). Remove them with:

bash
sudo apt-get purge linux-image-X.X.X-XX-generic

Replace X.X.X-XX-generic with the actual version number. Repeat for each old kernel. After removing old kernels, verify you've freed space:

bash
df -h /boot
3Reconfigure all partially-installed packages

Once you've freed space, use dpkg to retry configuring packages that failed:

bash
sudo dpkg --configure -a

This tells dpkg to configure all packages that are currently installed but not yet fully configured. If this succeeds, the post-installation script will complete.

4Fix broken dependencies if dpkg still fails

If the reconfigure step doesn't resolve the issue, try fixing broken package dependencies:

bash
sudo apt --fix-broken install

Or the older syntax:

bash
sudo apt-get install -f

This will attempt to resolve any missing dependencies or broken package installations.

5Check for problematic DKMS modules (if still failing)

If the above steps don't work, incompatible DKMS modules may be blocking installation. Check for DKMS errors in the output from step 3. Common problematic modules include:

- wireguard: No longer needed in kernels 5.x+
- evdi (DisplayLink): May not support newer kernel versions
- virtualbox-guest-additions: Version mismatch with kernel

For wireguard:

bash
sudo apt purge wireguard-dkms

For evdi/DisplayLink, check the Debian/Ubuntu repositories for a version compatible with your kernel version.

After removing the problematic package, retry:

bash
sudo dpkg --configure -a
6Update the initramfs and finish kernel installation

Once dpkg finishes, manually update the initramfs to ensure the kernel is fully configured:

bash
sudo update-initramfs -u -k all

Then, verify the kernel installation completed successfully:

bash
sudo apt update
sudo apt install --fix-broken

Advanced notes

DKMS Modules: The linux-image post-installation script automatically compiles DKMS modules for your specific kernel. If a module is incompatible or its source is missing, the entire post-installation will fail. Check /var/lib/dkms and module logs for details.

Firmware Packages: On some systems, linux-firmware package corruption can also cause post-installation script failures. If you see "linux-firmware (--configure): package is in a very bad inconsistent state", reinstall it: sudo apt install --reinstall linux-firmware

SELinux/AppArmor: On systems with SELinux enabled, permission issues during kernel installation can also cause failures. Check dmesg for AppArmor denials.

Rootless Systems: On rootless Docker or certain container environments, kernel modules cannot be installed. The error is expected and harmless in these cases.

Frequently asked questions

What does "1" mean?
When you install or update a Linux kernel on Debian-based systems (Ubuntu, Linux Mint, Debian), the linux-image package includes a post-installation script that sets up the kernel, generates initramfs images, and installs DKMS modules. If this script fails with exit status 1, it means the kernel installation process encountered an error that prevented it from completing successfully. The most common cause is insufficient space in the /boot partition, but it can also result from incompatible or missing kernel modules (DKMS modules like wireguard or displaylink), corrupted package metadata, or interrupted installations.
How do I fix "1"?
The dpkg post-installation script for linux-image failed with exit status 1, typically due to a full /boot partition, incompatible kernel modules, or corrupted package metadata. This can be fixed by freeing space, removing old kernels, or reconfiguring dpkg.
What causes "1"?
The /boot partition is full or nearly full, leaving no space for kernel images or initramfs files One or more DKMS modules (third-party kernel modules) are incompatible with the kernel version being installed The dpkg package database is corrupted or in an inconsistent state from a previous failed installation
Is the "1" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading