How to fix dpkg: error: unable to make backup link of './path' before installing new version in APT

APTINTERMEDIATEHIGHUpdated Dec 29, 2025ยท 298 views

This error occurs when dpkg cannot create backup copies of files before updating packages, typically due to filesystem limitations or file attribute restrictions. It usually affects /boot with FAT32 EFI partitions or files with immutable flags set.

Quick fix

Fixes dpkg: error: unable to make backup link of './path' before installing new version

# If error shows file path like ./usr/bin/sshd
lsattr /usr/bin/sshd

# Output with immutable flag looks like: ----i---------
  1. Check if files have immutable attributes
  2. Check filesystem mount status and FAT32 /boot partition
  3. Fix FAT32 /boot configuration (if applicable)
  4. Force dpkg to reconfigure packages
apt โ€” error
# If error shows file path like ./usr/bin/sshd
lsattr /usr/bin/sshd
# Output with immutable flag looks like: ----i---------
dpkg: error: unable to make backup link of './path' before installing new version

What this error means

When dpkg upgrades a package, it follows a strict safety procedure: create a hardlink backup of the old file, then replace the original with the new version. If the hardlink fails, dpkg stops and reports "unable to make backup link." This error specifically indicates that the filesystem cannot create the hardlink necessary for the safe upgrade process. The error message shows the file path that failed (e.g., ./usr/bin/sshd or a kernel module in /boot). Common scenarios: FAT32 EFI partitions don't support hardlinks at all, immutable file attributes (set with chattr +i) prevent any modifications, SELinux policies may deny link creation, or other filesystem restrictions block the operation.

Typical symptoms

  • apt upgrade or apt install fails with this dpkg error
  • Specific error message shows file path that cannot be backed up
  • Error appears when updating kernel packages or critical system binaries
  • Previous upgrades worked, but new packages trigger the error
  • All package manager operations fail until the underlying issue is resolved

Common causes

  1. FAT32 EFI partition mounted at /boot lacks hardlink support needed by dpkg
  2. Files have immutable attribute set with chattr +i, preventing any modification
  3. SELinux or AppArmor security policies denying link creation
  4. Read-only filesystem or partition mounted as read-only
  5. Filesystem corruption or special file attributes from previous operations

How to fix "dpkg: error: unable to make backup link of './path' before installing new version"

1Check if files have immutable attributes

Use lsattr to check for the immutable flag on the problematic file:

bash
# If error shows file path like ./usr/bin/sshd
lsattr /usr/bin/sshd

# Output with immutable flag looks like: ----i---------

If you see an 'i' in the output, the file has the immutable flag. Remove it:

bash
sudo chattr -i /usr/bin/sshd

Try the upgrade again. This resolves the issue in most cases.

2Check filesystem mount status and FAT32 /boot partition

List your mounted filesystems to check for /boot on FAT32:

bash
mount | grep -E '(^/dev|/boot)'

If /boot shows 'vfat' (FAT32), dpkg cannot create hardlinks. Check if a /boot/efi directory exists:

bash
ls -ld /boot/efi

Modern Debian/Ubuntu systems should have /boot/efi for EFI partition mounting, with actual boot files in /boot (on ext4/btrfs). If /boot itself is mounted on FAT32, this is the root cause.

3Fix FAT32 /boot configuration (if applicable)

If /boot is FAT32, you need to reorganize: mount the FAT32 EFI partition at /boot/efi instead.

bash
# Check current fstab
cat /etc/fstab

# Look for the FAT32 partition UUID/path currently at /boot
# You may need to:
# 1. Create /boot/efi directory
# 2. Move contents from /boot to /boot/efi
# 3. Update /etc/fstab to mount EFI partition at /boot/efi
# 4. Create a regular /boot directory on the main filesystem

This is a complex operation. Document the current fstab, then carefully update mount points. After changes:

bash
sudo update-grub
sudo update-initramfs -u

This permanent fix allows dpkg to operate safely on /boot files.

4Force dpkg to reconfigure packages

If no immutable attributes or FAT32 issues, try reconfiguring dpkg:

bash
# Stop package managers
sudo systemctl stop apt-daily-upgrade.service apt-daily.service

# Reconfigure packages
sudo dpkg --configure -a

# Try upgrade again
sudo apt update && sudo apt upgrade

This completes any interrupted package installations.

5Check for SELinux or AppArmor restrictions (if applicable)

If you're on a system with SELinux or AppArmor:

bash
# Check SELinux status
getenforce

# Check AppArmor status
sudo systemctl status apparmor

If either is enabled and you suspect they're blocking operations:

bash
# For SELinux, check audit logs
sudo grep dpkg /var/log/audit/audit.log

# For AppArmor, check logs
sudo grep dpkg /var/log/syslog

Security policies are rarely the culprit, but worth checking if other steps fail.

Advanced notes

This error reveals fundamental dpkg safety mechanisms. dpkg creates hardlinks (not copies) for performance and atomicity: if the system crashes mid-upgrade, it can restore from the hardlink without data loss. This is why it's non-negotiable.

FAT32 partitions predate Linux and don't support advanced filesystem features like hardlinks. Modern systems using UEFI firmware should use /boot/efi (FAT32, small) for EFI binaries and /boot (ext4, larger) for kernel images. If your system has /boot on FAT32, you have an unusual configuration that should be reorganized.

Immutable attributes (chattr +i) exist for system protection in some setups, but they block routine updates. If you set them yourself, remove them. If they exist mysteriously, check for rootkits or file integrity monitoring systems.

For most users: check for immutable attributes first (fastest), then examine /boot. FAT32 /boot is the second most common cause.

Frequently asked questions

What does "dpkg: error: unable to make backup link of './path' before installing" mean?
When dpkg upgrades a package, it follows a strict safety procedure: create a hardlink backup of the old file, then replace the original with the new version. " This error specifically indicates that the filesystem cannot create the hardlink necessary for the safe upgrade process. /usr/bin/sshd or a kernel module in /boot).
How do I fix "dpkg: error: unable to make backup link of './path' before installing"?
This error occurs when dpkg cannot create backup copies of files before updating packages, typically due to filesystem limitations or file attribute restrictions. It usually affects /boot with FAT32 EFI partitions or files with immutable flags set.
What causes "dpkg: error: unable to make backup link of './path' before installing"?
FAT32 EFI partition mounted at /boot lacks hardlink support needed by dpkg Files have immutable attribute set with chattr +i, preventing any modification SELinux or AppArmor security policies denying link creation
Is the "dpkg: error: unable to make backup link of './path' before installing" 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