How to fix dpkg: error: unable to access dpkg status area: Read-only file system in APT

APTINTERMEDIATECRITICALUpdated Dec 29, 2025ยท 248 views

The dpkg status area has become read-only, blocking package installations and updates. This usually means your filesystem encountered an error and was mounted in read-only mode for protection. Remounting it as read-write or fixing filesystem errors will resolve the issue.

Quick fix

Fixes dpkg: error: unable to access dpkg status area: Read-only file system

mount | grep -E "on / |read-only"
  1. Check current filesystem mount status
  2. Check available disk space
  3. Remount the filesystem as read-write
  4. Check for and remove stale dpkg locks
apt โ€” error
mount | grep -E "on / |read-only"
dpkg: error: unable to access dpkg status area: Read-only file system

What this error means

When your system's filesystem detects corruption or I/O errors, it automatically switches to read-only mode to prevent further data loss. The dpkg package manager stores its status database in /var/lib/dpkg/, and when this directory becomes inaccessible due to read-only mounting, all apt and dpkg operations fail. This error typically indicates either a hardware issue, filesystem corruption, or that your filesystem was improperly unmounted. In rare cases, it may indicate disk space issues or a previous system crash that left the filesystem in an inconsistent state.

Typical symptoms

  • apt install, apt update, or dpkg commands fail immediately with the read-only error
  • System cannot perform any package management operations
  • Other filesystem operations may also fail if the entire root filesystem is read-only
  • System was possibly shut down improperly or experienced a crash

Common causes

  1. Filesystem mounted in read-only mode due to detected errors or I/O errors from hardware issues
  2. Improper system shutdown or crash that left the filesystem in an inconsistent state
  3. Disk space exhausted, causing filesystem to become read-only as a safety measure
  4. Hardware failure (failing hard drive or SSD) causing kernel to remount filesystem as read-only
  5. Active lock on /var/lib/dpkg from another process or interrupted dpkg operation

How to fix "dpkg: error: unable to access dpkg status area: Read-only file system"

1Check current filesystem mount status

Run the mount command to see if your root filesystem is mounted as read-only:

bash
mount | grep -E "on / |read-only"

If you see "read-only" in the output, your filesystem needs to be remounted as read-write. If it shows read-write, proceed to the next step.

2Check available disk space

A full filesystem can become read-only. Check your disk usage:

bash
df -h

If any filesystem shows 100% usage, delete unnecessary files or logs to free up space. Check /var/log for large log files that can be safely removed.

3Remount the filesystem as read-write

If the filesystem is mounted read-only, remount it with write access:

bash
sudo mount -o remount,rw /

After remounting, test if dpkg works:

bash
sudo apt update

This is a temporary fix. Reboot if you want the system to remount permanently after fixing underlying issues.

4Check for and remove stale dpkg locks

If the filesystem is writable but dpkg still fails, check for lock files:

bash
sudo lsof /var/lib/dpkg/lock
sudo fuser -v /var/lib/dpkg/lock

If you see processes, either wait for them to complete or kill them (use with caution):

bash
sudo killall apt apt-get dpkg
sudo rm -f /var/lib/apt/lists/lock
sudo rm -f /var/cache/apt/archives/lock

Then try the operation again:

bash
sudo dpkg --configure -a
sudo apt update
5Run filesystem check from a live environment (persistent read-only)

If remounting doesn't work, you likely have filesystem corruption. Boot from a live USB/CD and run fsck:

1. Insert a live Ubuntu USB and boot from it
2. From the live environment, run:

bash
sudo fsck /dev/sdX#

Replace /dev/sdX# with your actual root partition (found via lsblk or sudo fdisk -l). This will check and repair filesystem errors.

3. After fsck completes, reboot into your normal system.

Advanced notes

For production servers experiencing persistent read-only filesystem issues, consider these advanced troubleshooting steps:

1. Hardware Diagnostics: If fsck repairs don't persist, run hardware diagnostics:

bash
sudo smartctl -a /dev/sdX

2. SELinux or AppArmor: On systems with mandatory access controls, check if policies are blocking dpkg. Run sudo getenforce (SELinux) or check AppArmor status.

3. LVM or Encrypted Volumes: If using LVM or LUKS encryption, the issue may be at the volume level. Check sudo pvs and sudo lvs for errors.

4. Systemd Journal: For clues about filesystem errors, check:

bash
sudo journalctl -p err --no-pager | tail -50

5. Mount Options: Some filesystems have additional mount options. Check /etc/fstab and ensure no options like ro (read-only) are set for your root filesystem.

If hardware diagnostics show failures or fsck cannot repair the filesystem, backup your data immediately as the drive may be failing.

Frequently asked questions

What does "dpkg: error: unable to access dpkg status area: Read-only file system" mean?
When your system's filesystem detects corruption or I/O errors, it automatically switches to read-only mode to prevent further data loss. The dpkg package manager stores its status database in /var/lib/dpkg/, and when this directory becomes inaccessible due to read-only mounting, all apt and dpkg operations fail. This error typically indicates either a hardware issue, filesystem corruption, or that your filesystem was improperly unmounted.
How do I fix "dpkg: error: unable to access dpkg status area: Read-only file system"?
The dpkg status area has become read-only, blocking package installations and updates. This usually means your filesystem encountered an error and was mounted in read-only mode for protection. Remounting it as read-write or fixing filesystem errors will resolve the issue.
What causes "dpkg: error: unable to access dpkg status area: Read-only file system"?
Filesystem mounted in read-only mode due to detected errors or I/O errors from hardware issues Improper system shutdown or crash that left the filesystem in an inconsistent state Disk space exhausted, causing filesystem to become read-only as a safety measure
Is the "dpkg: error: unable to access dpkg status area: Read-only file system" error serious?
Yes. This is a critical-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading