Ubuntu – Dpkg warning files list file for package missing

aptdpkg

I tried to install a package and it did, and it appears to work just fine. However when I installed it I got several warnings about packages being missing.

dpkg: warning files list file for package '...' missing, assuming package has no files currently installed.

Since it is just a warning and it appears to work anyway, I assumed that it doesn't matter, but I would like someone to confirm that.

The packages that are missing are ones that I uninstalled on purpose because they were non-essential and took up a lot of room.

EDIT: Package is tzdata. Using dpkg -i on a .deb file to install. And the above is essentially the entire warning. Just instead of … it lists packages. python2.7-minimal, libsqlite3-0, libaprutill-dbd-sqlite3, python-minimal`

EDIT: "What exactly did you do?" I ran the command

dpkg -i tzdata_2017b-2_all.deb

to install the package tzdata.

"What did you want to achieve?" I wanted the package to install.

"What happened instead? Did you encounter any warning or error messages?" The package installed and worked fine. However, the above warning appeared for the above packages.

I cannot copy and paste since this is occurring on a separate server. But I will rewrite it here:

dpkg: warning files list file for package python2.7-minimal missing, assuming package has no files currently installed.
dpkg: warning files list file for package libsqlite3-0 missing, assuming package has no files currently installed.
dpkg: warning files list file for package libaprutill-dbd-sqlite3, assuming package has no files currently installed.
dpkg: warning files list file for package python-minimal, assuming package has no files currently installed.

I am not looking for a fix. I am just curious if dpkg giving me a warning in this type of situation actually matters. Again the program works anyway and nothing else on my system needed those packages.

Best Answer

Have a look at this Serverfault question.

You might want to try something like this:

for package in $(apt-get upgrade 2>&1 |\
                 grep "warning: files list file for package '" |\
                 grep -Po "[^'\n ]+'" | grep -Po "[^']+"); do
    apt-get install --reinstall "$package";
done

Copy/paste friendly in one line:

for package in $(apt-get upgrade 2>&1 | grep "warning: files list file for package '" | grep -Po "[^'\n ]+'" | grep -Po "[^']+"); do apt-get install --reinstall "$package"; done

Be aware that running this command takes some time as it cycles through every package.

I wanted to suggest something similar to the accepted answer there before I found this. And I don't have enough reputation to add this as a comment.

Unfortunately I can't answer why this is happening. I had this problem after a dist-upgrade, and fixed it by reinstalling the packages.

Related Question