How to fix E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel installation in APT

APTINTERMEDIATEHIGHUpdated Dec 29, 2025ยท 218 views

The "Sub-process /usr/bin/dpkg returned an error code (1)" error occurs when the Debian package manager fails during kernel installation, typically due to corrupted package database, interrupted installation, or insufficient disk space. This can be fixed by reconfiguring dpkg, fixing broken dependencies, or freeing disk space.

Quick fix

Fixes E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel installation

sudo dpkg --configure -a
  1. Reconfigure the dpkg database
  2. Fix broken dependencies
  3. Check and free /boot partition space
  4. Clean package cache
apt โ€” error
sudo dpkg --configure -a
E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel installation

What this error means

This error indicates that dpkg (Debian Package manager) encountered a fatal error while processing kernel installation. The error code 1 is a generic failure code that can result from various issues: interrupted package operations, corrupted package database state, missing or conflicting files, disk space exhaustion (especially in the /boot partition which often runs out of space during kernel updates), or conflicts with third-party kernel modules. When installing a new kernel, dpkg needs to write files to the /boot partition and update the system state. If this process fails midway (due to interruption, reboot, or corruption), the package manager gets stuck in an inconsistent state. Unlike simple package installation failures, kernel installation problems are particularly critical because the system may not boot properly if the kernel installation is incomplete.

Typical symptoms

  • Kernel update fails with error message containing 'Sub-process /usr/bin/dpkg returned an error code (1)'
  • System cannot proceed with kernel installation even after retry
  • Ubuntu/Debian package manager reports broken dependencies
  • apt-get update or apt-get upgrade commands fail mid-operation
  • /boot partition shows as full (df -h /boot)

Common causes

  1. Package installation process was interrupted (Ctrl+C, power loss, or system crash during update)
  2. Corrupted dpkg database state from previous failed package operations
  3. /boot partition is full due to accumulated old kernel versions
  4. Insufficient free disk space in root (/) or /boot partitions
  5. Conflicting kernel modules or third-party drivers (VirtualBox, Anbox, etc.) preventing compilation
  6. Concurrent package operations or locked package database

How to fix "E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel installation"

1Reconfigure the dpkg database

The most common and straightforward fix is to reconfigure the dpkg package database, which can repair corruption from interrupted operations:

bash
sudo dpkg --configure -a

This command completes any pending configurations and clears the package manager's stuck state. Wait for it to complete fully before proceeding.

2Fix broken dependencies

After reconfiguring dpkg, fix any broken dependencies that may remain:

bash
sudo apt install -f

or alternatively:

bash
sudo apt --fix-broken install

This attempts to resolve missing or conflicting packages and complete the interrupted installation.

3Check and free /boot partition space

A common cause of kernel installation failures is a full /boot partition. Check current space usage:

bash
df -h /boot

If /boot is more than 90% full, remove old kernel versions:

bash
sudo apt autoremove --purge

To manually remove a specific old kernel (replace VERSION with actual version):

bash
sudo apt remove --purge linux-image-VERSION
sudo apt remove --purge linux-headers-VERSION
4Clean package cache

Clear the package cache to remove corrupted or incomplete downloaded files:

bash
sudo apt clean
sudo apt update

Then attempt the kernel installation again:

bash
sudo apt upgrade
5Remove problematic kernel packages manually

If the above steps don't work, you may need to force-remove the problematic kernel package. First, identify which kernel version is causing issues by checking the error output. Then remove it:

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

Replace the version numbers with the actual kernel version from the error message. After removal:

bash
sudo dpkg --configure -a
sudo apt install -f
6Check for insufficient disk space

Verify that you have adequate free space on your root partition (at least 500MB free recommended for kernel operations):

bash
df -h /

If disk space is critically low (less than 10% free), remove unnecessary files or applications. You can find large files with:

bash
sudo du -sh /var/cache/*
sudo du -sh /tmp/*

Then clean up cache directories:

bash
sudo apt clean
sudo apt autoclean
sudo rm -rf /tmp/*
7Disable third-party kernel modules

If you have VirtualBox, Anbox, or other software that compiles kernel modules, these may fail to compile during kernel updates. As a temporary measure, uninstall them:

bash
sudo apt remove --purge virtualbox-dkms
sudo apt remove --purge anbox-modules-dkms

Then retry the kernel installation. After the kernel is successfully installed, you can reinstall these packages if needed.

8Try a clean installation if all else fails

If the above steps don't resolve the issue, attempt a clean installation. First, check the dpkg log for the exact error:

bash
tail -100 /var/log/dpkg.log

If you see a specific package name failing (e.g., linux-image-5.10.0-18), remove all related packages:

bash
sudo apt remove --purge linux-image-5.10.0-18-generic
sudo apt remove --purge linux-headers-5.10.0-18
sudo apt remove --purge linux-headers-5.10.0-18-generic

Then clean and update:

bash
sudo apt clean
sudo apt update
sudo apt upgrade

Advanced notes

For Raspberry Pi users and other ARM-based systems, the kernel installation process is identical, but you may encounter architecture-specific kernel versions (like linux-image-arm64). The same dpkg recovery steps apply.

If you're running Ubuntu on a server with automatic security updates enabled, the update process may fail silently without intervention. Check /var/log/apt/term.log for detailed error information.

On systems using SELinux or AppArmor, kernel module compilation errors may have additional security-related warnings. Review the full /var/log/dpkg.log to distinguish between permission issues and actual dpkg database corruption.

Frequently asked questions

What does "E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel" mean?
This error indicates that dpkg (Debian Package manager) encountered a fatal error while processing kernel installation. The error code 1 is a generic failure code that can result from various issues: interrupted package operations, corrupted package database state, missing or conflicting files, disk space exhaustion (especially in the /boot partition which often runs out of space during kernel updates), or conflicts with third-party kernel modules. When installing a new kernel, dpkg needs to write files to the /boot partition and update the system state.
How do I fix "E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel"?
The "Sub-process /usr/bin/dpkg returned an error code (1)" error occurs when the Debian package manager fails during kernel installation, typically due to corrupted package database, interrupted installation, or insufficient disk space. This can be fixed by reconfiguring dpkg, fixing broken dependencies, or freeing disk space.
What causes "E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel"?
Package installation process was interrupted (Ctrl+C, power loss, or system crash during update) Corrupted dpkg database state from previous failed package operations /boot partition is full due to accumulated old kernel versions
Is the "E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel" 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