APT: fix broken package
Recover Debian/Ubuntu when apt reports that a package needs to be reinstalled but has no archive.
1 min read
Updated
When apt refuses to install a package because it believes the package needs reinstalling but cannot find an archive, the fix is to remove the stale entry manually and force the package out. This is the sequence that recovers the package database. The error message and the commands are shown below.
This snippet explains how to fix this error kind when trying to install a package on Ubuntu:
text
The package XXX needs to be reinstalled, but I can't find an archive for itbash
sudo rm -rf /var/lib/dpkg/info/XXX.*
sudo dpkg --remove --force-remove-reinstreq XXX