How to fix dpkg: error: failed to open package info file '/var/lib/dpkg/available' for reading: No such file or directory in APT
The dpkg available file is missing or corrupted, preventing package installations. This file tracks available packages from repositories and can be rebuilt by merging package lists from apt.
Quick fix
Fixes dpkg: error: failed to open package info file '/var/lib/dpkg/available' for reading: No such file or directory
sudo dpkg --clear-avail
for i in /var/lib/apt/lists/*_Packages; do sudo dpkg --merge-avail "$i"; done- Clear the available file and rebuild it from repository lists
- Update your package lists
- Verify dpkg can read the available file
- Test package operations
sudo dpkg --clear-availfor i in /var/lib/apt/lists/*_Packages; do sudo dpkg --merge-avail "$i"; donedpkg: error: failed to open package info file '/var/lib/dpkg/available' for reading: No such file or directory
What this error means
The `/var/lib/dpkg/available` file is dpkg's database of packages available for installation from your configured repositories. When this file is missing or unreadable, dpkg cannot proceed with package operations. This typically occurs after accidental deletion, system corruption, or incomplete package management operations. While dpkg uses this file internally, apt-based systems maintain their own package cache, so the file can be safely reconstructed from repository data.
Typical symptoms
- dpkg operations fail immediately with "failed to open package info file" error
- apt-get install, apt-get update, and dpkg commands become unusable
- Package installation is completely blocked until the file is restored
- System cannot read or write to /var/lib/dpkg/available
Common causes
- The /var/lib/dpkg/available file was accidentally deleted or removed
- File system corruption or disk errors damaged the dpkg database files
- Interrupted or failed package management operations that corrupted dpkg state
- Manual cleanup or system maintenance that removed critical dpkg files
- Permission issues preventing dpkg from accessing the file
How to fix "dpkg: error: failed to open package info file '/var/lib/dpkg/available' for reading: No such file or directory"
Run the following commands to remove the corrupted available file and reconstruct it from your apt repositories:
sudo dpkg --clear-avail
for i in /var/lib/apt/lists/*_Packages; do sudo dpkg --merge-avail "$i"; doneThe --clear-avail option erases the existing available file, and --merge-avail rebuilds it by reading the Packages lists from your configured repositories.
After rebuilding the available file, refresh your package lists to ensure everything is current:
sudo apt-get updateThis synchronizes your local package database with the latest information from your repositories.
Confirm the file was successfully created and is readable:
ls -la /var/lib/dpkg/available
file /var/lib/dpkg/availableThe file should exist and be readable by the dpkg process.
Try a simple package query to verify dpkg is working correctly:
sudo apt-cache search bash
sudo apt-get install -s nanoThe -s flag simulates an installation without actually installing, letting you verify dpkg functionality.
Advanced notes
If the above steps don't work, your dpkg status database may also be corrupted. Check /var/lib/dpkg/status and verify it's readable with file /var/lib/dpkg/status. If both files are missing, you can restore from backup: sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status. For systems using dselect (older systems), the available file is more critical, but modern apt-based systems primarily use dpkg's status file. In severe corruption cases, you may need to boot from a live USB and repair the system from there.
Frequently asked questions
- What does "dpkg: error: failed to open package info file '/var/lib/dpkg/available" mean?
- The /var/lib/dpkg/available file is dpkg's database of packages available for installation from your configured repositories. When this file is missing or unreadable, dpkg cannot proceed with package operations. This typically occurs after accidental deletion, system corruption, or incomplete package management operations.
- How do I fix "dpkg: error: failed to open package info file '/var/lib/dpkg/available"?
- The dpkg available file is missing or corrupted, preventing package installations. This file tracks available packages from repositories and can be rebuilt by merging package lists from apt.
- What causes "dpkg: error: failed to open package info file '/var/lib/dpkg/available"?
- The /var/lib/dpkg/available file was accidentally deleted or removed File system corruption or disk errors damaged the dpkg database files Interrupted or failed package management operations that corrupted dpkg state
- Is the "dpkg: error: failed to open package info file '/var/lib/dpkg/available" 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
- ๐APT Official Documentation
- ๐man7.org - dpkg(1) Linux manual page(Official Docs)
- ๐Ubuntu Manpages - dpkg package manager documentation(Official Docs)
- ๐