How to fix subprocess new post-installation script returned error exit status 1 in APT

APTINTERMEDIATEHIGHUpdated Apr 23, 2026· 587 views

A dpkg post-installation script failed during package installation. This happens when a package's configuration script encounters an error after the main package files are extracted. Common causes include corrupted installations, broken dependencies, disk space issues, or DKMS module compilation failures.

Quick fix

Fixes subprocess new post-installation script returned error exit status 1

sudo dpkg --configure -a
  1. Attempt to reconfigure pending packages
  2. Fix broken dependencies
  3. Check available disk space
  4. Identify the problematic package
apt — error
sudo dpkg --configure -a
subprocess new post-installation script returned error exit status 1

What this error means

This error occurs when dpkg (Debian package manager) runs the post-installation script for a package and that script exits with status code 1, indicating failure. Post-installation scripts handle final configuration tasks like updating system files, registering services, or compiling kernel modules. When the script fails, the package remains partially configured and subsequent operations may fail. The error message indicates the script encountered an unrecoverable problem. This could be a missing dependency, insufficient disk space, permission issues, or a problem specific to your system configuration.

Typical symptoms

  • Package installation or upgrade stops with a dpkg error
  • Error message shows a specific package name and 'post-installation script subprocess returned error'
  • apt or apt-get commands fail when trying to install or upgrade packages
  • System is left in an inconsistent state with partially configured packages
  • Other package operations fail with dependency errors

Common causes

  1. The post-installation script depends on files or packages that are missing or not properly installed
  2. Insufficient disk space in /boot or / partitions prevents the script from completing
  3. DKMS modules (like NVIDIA drivers or displaylink) fail to compile during the post-installation phase
  4. The package database (/var/lib/dpkg) is corrupted from a previous interrupted installation
  5. initramfs-tools or kernel hooks fail when updating the initial ramdisk image
  6. Permission issues prevent the post-installation script from executing
  7. System configuration conflicts or missing expected files like /boot/grub or /etc/init.d services

How to fix "subprocess new post-installation script returned error exit status 1"

1Attempt to reconfigure pending packages

Run this command to fix any packages that are installed but not fully configured:

bash
sudo dpkg --configure -a

This tells dpkg to configure all packages that have pending configuration. In many cases, this resolves the issue automatically.

2Fix broken dependencies

If the above doesn't work, repair any broken dependencies:

bash
sudo apt install -f

The -f flag stands for --fix-broken and will attempt to install missing packages or upgrade packages to fix dependency issues.

3Check available disk space

Verify you have sufficient disk space, especially in the /boot and / partitions:

bash
df -h

If any partition shows 100% or close to it (especially /boot), you'll need to free up space before the package can complete installation. Remove old kernel images or unnecessary files.

4Identify the problematic package

Look at the full error message to identify which specific package is causing the issue. The error will typically show the package name. You can check the dpkg log for more details:

bash
cat /var/log/dpkg.log | tail -20

This shows recent dpkg operations and may reveal what failed.

5Remove and reinstall the problematic package

Once you've identified the package, try removing and reinstalling it:

bash
sudo apt remove <package-name>
sudo apt install <package-name>

Replace <package-name> with the actual package name. This forces a clean installation from scratch.

6For DKMS-related errors

If the error mentions DKMS, kernel modules, or drivers (like nvidia, displaylink, evdi), try rebuilding the DKMS modules:

bash
sudo dkms autoinstall

You can check which DKMS modules are installed:

bash
dkms status

If a specific module is failing, you can check its build log:

bash
cat /var/lib/dkms/<module-name>/<version>/build/make.log
7Clear apt cache and update

Clean the apt cache and refresh package lists:

bash
sudo apt clean
sudo apt update

Then try installing packages again. This clears any corrupted cache that might be interfering.

8Advanced: Remove problematic package scripts

If all else fails, you can temporarily bypass the problematic post-installation script. This is a last resort:

bash
ls /var/lib/dpkg/info/ | grep <package-name>

Locate the .postinst file for your package, then move it:

bash
sudo mv /var/lib/dpkg/info/<package-name>.postinst /tmp/<package-name>.postinst.bak

Now try reconfiguring:

bash
sudo dpkg --configure -a

WARNING: This bypasses important configuration steps. Only use if the package is non-critical and you understand the consequences.

Advanced notes

Post-installation scripts are critical for completing package setup. They often handle tasks like:

- Registering systemd services or init.d scripts
- Updating the GRUB bootloader configuration
- Compiling DKMS kernel modules
- Setting up user accounts or permissions
- Updating the initramfs (initial RAM filesystem)

Different packages have different requirements. For example, linux-image packages may fail if there's no /boot/grub directory. DKMS-based packages (like NVIDIA drivers) fail if compilation fails due to missing kernel headers or build tools.

Always check the error message carefully for clues about which specific step failed. The error number (1, 127, etc.) and any preceding error messages are crucial for diagnosis. If you need to manually debug a post-installation script, you can examine it at /var/lib/dpkg/info/<package-name>.postinst - it's a shell script and may give clues about what it's trying to do.

Frequently asked questions

What does "subprocess new post-installation script returned error exit status 1" mean?
This error occurs when dpkg (Debian package manager) runs the post-installation script for a package and that script exits with status code 1, indicating failure. Post-installation scripts handle final configuration tasks like updating system files, registering services, or compiling kernel modules. When the script fails, the package remains partially configured and subsequent operations may fail.
How do I fix "subprocess new post-installation script returned error exit status 1"?
A dpkg post-installation script failed during package installation. This happens when a package's configuration script encounters an error after the main package files are extracted. Common causes include corrupted installations, broken dependencies, disk space issues, or DKMS module compilation failures.
What causes "subprocess new post-installation script returned error exit status 1"?
The post-installation script depends on files or packages that are missing or not properly installed Insufficient disk space in /boot or / partitions prevents the script from completing DKMS modules (like NVIDIA drivers or displaylink) fail to compile during the post-installation phase
Is the "subprocess new post-installation script returned error exit status 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