How to fix update-initramfs: failed for /boot/initrd.img-X.X.X with 1 in APT

APTINTERMEDIATEHIGHUpdated Dec 29, 2025ยท 395 views

The update-initramfs command failed while trying to generate a new initial RAM filesystem. This typically occurs due to insufficient disk space in the /boot partition or missing kernel modules.

Quick fix

Fixes update-initramfs: failed for /boot/initrd.img-X.X.X with 1

df -h /boot
  1. Check available space in /boot partition
  2. Remove old kernel versions to free space
  3. Manually clean old initrd files if space is still tight
  4. Attempt to regenerate the initramfs
apt โ€” error
df -h /boot
update-initramfs: failed for /boot/initrd.img-X.X.X with 1

What this error means

The `update-initramfs` tool is responsible for creating and updating the initramfs (initial RAM filesystem) for your Linux kernel. This image contains essential drivers and modules needed to boot your system. Exit code 1 indicates a generic failure, most commonly caused by a full /boot partition that doesn't have enough space to write the new initrd.img file.

Typical symptoms

  • Ubuntu/Debian kernel updates fail during installation
  • /boot partition shows 100% disk usage (df -h /boot)
  • Cannot install new kernel packages without errors
  • System may fail to boot after interrupted kernel update
  • Package manager shows errors during apt upgrade

Common causes

  1. Insufficient disk space in /boot partition (most common cause - /boot is often a separate small partition)
  2. Multiple old kernel versions accumulating and consuming space
  3. Corrupt or missing kernel module files
  4. Permission issues on /boot directory preventing file writes
  5. Broken initramfs-tools hooks (from third-party packages like ntfs_3g)
  6. Missing font files required by Plymouth boot splash

How to fix "update-initramfs: failed for /boot/initrd.img-X.X.X with 1"

1Check available space in /boot partition

First, verify that the /boot partition actually has space issues:

bash
df -h /boot

If /boot shows 100% or very high usage (>90%), this is your problem. The initramfs generator needs temporary space to create the new image before moving it into place.

2Remove old kernel versions to free space

Use apt's automatic removal tool to safely remove obsolete kernel packages:

bash
sudo apt autoremove --purge

This command removes old kernel images and headers that are no longer needed, typically freeing 100-500MB. Verify the cleanup worked:

bash
df -h /boot

If you need more aggressive cleanup, manually list and remove specific old kernels:

bash
dpkg --list | grep linux-image
sudo apt remove linux-image-5.4.0-42-generic  # Replace with actual old version

Important: Never remove the kernel version you're currently running. Check your current version with uname -r.

3Manually clean old initrd files if space is still tight

If autoremove didn't free enough space, you can manually delete old initrd.img files:

bash
ls -la /boot/initrd*
sudo rm /boot/initrd.img-5.4.0-42-generic  # Only remove OLD versions

Each initrd.img file is typically 30-50MB. Make sure you keep the one for your current kernel (check with uname -r).

4Attempt to regenerate the initramfs

Once you have freed space, try updating the initramfs again:

bash
sudo update-initramfs -u

For a specific kernel version:

bash
sudo update-initramfs -u -k 5.15.0-56-generic

For all kernels:

bash
sudo update-initramfs -u -k all

Watch for the success message confirming the initramfs was created.

5Fix broken package dependencies if update still fails

If the error persists after freeing space, there may be broken package dependencies:

bash
sudo apt install -f
sudo dpkg --configure -a

These commands fix broken package installations and reconfigure packages that may have been interrupted. Then retry the update-initramfs command.

6Recreate initramfs from scratch if needed

As a last resort, force a complete recreation of the initramfs for your current kernel:

bash
sudo update-initramfs -c -k $(uname -r)

The -c flag creates a new initramfs from scratch rather than updating an existing one. This bypasses some corruption issues.

Advanced notes

Plymouth Font Issues: Some systems fail due to missing Plymouth boot splash fonts. If errors mention 'fonts-ubuntu' or 'DejaVuSansMono', reinstall with: sudo apt install --reinstall fonts-ubuntu followed by sudo update-initramfs -u.

Third-Party Hook Failures: Errors like 'hooks/ntfs_3g failed with return 1' indicate a broken hook from an installed tool. Temporarily disable with: sudo chmod -x /usr/share/initramfs-tools/hooks/ntfs_3g then run sudo apt install -f and sudo update-initramfs -u. Re-enable with sudo chmod +x after fixing.

Boot Partition Size: If /boot repeatedly fills up, consider resizing it. A typical /boot partition should be at least 500MB-1GB. Use tools like GParted in a live environment to resize if needed.

Recovery Mode: If your system becomes unbootable after a failed kernel update, boot into Recovery Mode from the GRUB menu and run these commands to repair.

Frequently asked questions

What does "update-initramfs: failed for /boot/initrd.img-X.X.X with 1" mean?
The update-initramfs tool is responsible for creating and updating the initramfs (initial RAM filesystem) for your Linux kernel. This image contains essential drivers and modules needed to boot your system. img file.
How do I fix "update-initramfs: failed for /boot/initrd.img-X.X.X with 1"?
The update-initramfs command failed while trying to generate a new initial RAM filesystem. This typically occurs due to insufficient disk space in the /boot partition or missing kernel modules.
What causes "update-initramfs: failed for /boot/initrd.img-X.X.X with 1"?
Insufficient disk space in /boot partition (most common cause - /boot is often a separate small partition) Multiple old kernel versions accumulating and consuming space Corrupt or missing kernel module files
Is the "update-initramfs: failed for /boot/initrd.img-X.X.X with 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