Here is the output I got from apt-get
:
dpkg: warning: files list file for package `libecryptfs0' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `libplexus-containers1.5-java' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `apport' missing, assuming package has no files currently installed.
And this is how I fixed it:
Backup the dpkg status file:
cp /var/lib/dpkg/status{,.backup}
Edit the /var/lib/dpkg/status
file¹ and remove the sections for the packages that apt-get
printed warnings about. Make sure that you remove the whole section about these packages, i. e. starting with the line Package: libecryptfs0
down to the first blank line.
Alternatively you can use sed
to do the work for you:
sed -i.backup -e '/^Package: \(libecryptfs0\|libplexus-containers1\.5-java\|apport\)$/,/^$/d' /var/lib/dpkg/status
This command deletes all sections between and including the lines with Package: <PACKAGE_NAME>
and the next empty line. You can place any valid package names between the parentheses \(…\)
, delimit them with \|
, and escape the dots (.
→ \.
). The option -i.backup
edits the file in place and creates a backup file suffixed with .backup
(so you can skip step 1 if you use variant) instead of writing the result to stdout.
Run sudo apt-get -f install
to configure unconfigured packages and (re-)install missing package. The packages are missing because we removed them from the status
file.
¹ See How do I get permissions to edit system configuration files? for how to that.