10

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.

5
  • 2
    which package are you installing, how are you installing it, which platform are you ? edit your question and attach full error.
    – saviour123
    Aug 25, 2017 at 15:05
  • 2
    uh... what made you think those packages were non-essential? O.O Here's what APT will do if I remove python-minimal (removing all the packages that depend on python-minimal) How did you uninstall them? Apparently dpkg doesn't know about it
    – Zanna
    Aug 30, 2017 at 8:30
  • Could you please add a little more detail? What exactly did you do, what did you want to achieve and what happened instead? Did you encounter any warning or error messages? Please reproduce them in their entirety in your question. You can select, copy and paste terminal content and most dialogue messages in Ubuntu. (see How do I ask a good question?) Aug 30, 2017 at 11:23
  • Possible duplicate of askubuntu.com/questions/715558/… Aug 30, 2017 at 21:29
  • I have a similar output from a previous LibreOffice installation. I uninstalled a version included with the distro (Ubuntu) using apt, then downloaded a newer version as a .deb file and used dpkg -i to install. Since I don't want to re-install the previous version just to clear a warning, I saw another answer that eluded to .list files in the /var/lib/dpkg directory and found some under the subdirectory info related to LibreOffice. Now I'm just wondering if removing those will clear the issue, or will it disrupt my ability to use dpkg -r to remove the current version?
    – Chezzwizz
    Apr 12, 2019 at 22:09

6 Answers 6

11

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.

4
  • I had seen this answer in other places. Although it might be correct to get rid of the warnings and reinstall the packages, I am looking for WHY it is happening and if it even matters. Since they are only listed as "warning" and not "severe warning" or "error", it appears to not be so serious. Again the package appears to be functioning just fine without these missing packages.
    – khm
    Aug 29, 2017 at 11:08
  • @fronk I did do anything in my terminal.he answer did respond or didn't do anything. I copy the script and pasted in a file named ls.sh and tried to run using "sudo ./ls.sh". No outputs, nothing.
    – Pranav
    Jul 24, 2019 at 12:02
  • thanx bro.. helped! Oct 2, 2019 at 13:28
  • Awesome! My only wish is that I had thought to use "apt-get -y install" within the loop so that I didn't have to sit there to watch and keep pressing Y+Enter for every broken package.
    – rsethc
    May 24, 2022 at 16:09
4

We had a RAID5 failure that seemed to come with some corruption of the dpkg list database so I encountered this problem recently, however the solution above didn't work, as apt-get install --reinstall xxx yielded more errors of dodgy list files. I did manage to resolve it in my case though, so here's the process I used.


In the end, the process that worked for me was to remove all the files corresponding to that package in the database, and reinstall after updating dpkg itself.

As an example, here's one such error (replace antlr with your missing package name from here on):

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

Which for me the solution was:

sudo mv /var/lib/dpkg/info/antlr* ~/var   # Backup in case of any other issues
                                          # Alternatively: sudo rm /var/lib/dpkg/info/antlr*

Then,

sudo dpkg --configure -a

The key seemed to be to run the configure command each time a package listing was removed (versus some other suggestions I've seen of nuking all the list files and then running apt-get update/upgrade).

Then finally, sudo apt-get install --reinstall antlr would complete correctly.

3
  • it did work on me. No "antlr" file/folder in the first place.
    – Pranav
    Jul 24, 2019 at 12:04
  • 1
    You may not have that particular package. That was just an example.
    – Joe Healey
    Jul 25, 2019 at 10:30
  • 1
    2 days of trying to solve a similar issue ended in a few seconds with your solution. Really Thanks Alot
    – Omar_Hafez
    Nov 10, 2023 at 13:26
2

I had the same issue on one of my instances and the fix for me was re-install the offending packages with apt:

sudo apt reinstall <package_name_1> <package_name_2>

After a successful re-install, re-running the same command and the error went away

0

This worked for me:

$ dpkg -S dummy query 2>/tmp/warnings
$ cat /tmp/warnings | awk '{print $8}' > /tmp/packages
# manually edit /tmp/packages to remove (') around package names. 
# Use a txt editor and just replaceall (') with nothing
# https://askubuntu.com/questions/12041/how-can-i-navigate-to-tmp
# then run the following:
$ for package in $(cat /tmp/packages); do echo apt-get install --reinstall $package; apt-get install --reinstall $package; done;

Source: https://forums.debian.net/viewtopic.php?t=119371

1
  • Note: I've rejected an edit on this from a new user, but I think the rejected edit would work okay as a separate answer. Mar 16 at 21:54
0

If you tried @fronk's answer but apt-get upgrade doesn't return any dpkg warnings but apt-get install <some dummy package> --reinstall does return dpkg errors. Replace apt-get upgrade with apt-get install <some dummy package> --reinstall like so:

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

For more information, I installed digikam onto pop_os 22.04 using the "Applications" gui, and it was functioning correctly, and launching from a shortcut.

If ran an "apt update/upgrade" cycle after that the application would not start either from the shortcut or from the "Applications" menu gui. It showed on that gui as installed, but nothing happened when I tried to launch it.

Uninstalling and then reinstalling fixed the issue, until the next 'update/upgrade' action, which would break it again.

I noticed that there was a "warning files list file for package digikam missing," during the 'upgrade' which I thought to investigate and so discovered this question.

My answer to the question "I am just curious if dpkg giving me a warning in this type of situation actually matters" is yes, this warning message could result in the application being incorrectly re-configured after every upgrade.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .