You are correct pacman -Qo
answers the question which package owns the file on the local system. I am so use to using -Fx and mentally filtering.
That’s why I used the word “might”
The .files represent the state of the repo, and the more I read I think that is the intended purpose, just not how I’ve used it.
Here’s a scenario:
- repo updated 01/01
- pacman -Syu was run on 01/01
- pacman -Fy was run on 01/01 (.files represents the contents of .db; everything matches repo)
- repo updated/newer 01/15
- pacman -Fy was run on 01/15 (now the .files represent only the contents of packages on the repo.)
If the files in the packages on the repo are the same from 01/01 and 01/15, it is a happy accident that .files matches .db contents. But if they aren’t, then the .files represent the repo and not the .db files.
I’ve always used .files as a representation of the files in packages that exist in my local sync databases, not the repos.
If a user runs pacman -Syu on a daily basis, it would make more sense to me to run pacman -Fy on a timer. But if a user updates monthly, it would make more sense to run pacman -Fy at that time so the .files match the .db. That is just how I’ve used pacman -Fyx over time. I do understand @cscs examples. The arch wiki on pkgfile does say, “pkgfile is a tool for searching files from packages in the official repositories.”. The man page isn’t as direct.
NOTE: .files and .db are shorthand for the files in /var/lib/pacman/sync/ which are managed by pacman. I used pacman -Fy, but I believe the same would be true for pkgfile -u, except files are in a different location.
From pacman man page for -y:
From pkgfile man page for -u:
I haven’t gone any further than reading the man page and arch wiki. But to me, it reads, if the repo is newer, the .files will be updated to reflect the repo at that point in time. If that is the desired outcome, the timer should be run.
This is similar to pamac-mirrorlist.{timer,service}. imho, the mirrors should be manipulated just before a user updates to reflect the status of the mirrors at that point in time. So in summary, the consecutive steps become (without timers):
Read Announcement
pacman-mirrors -f5 # continue only if up to date available mirrors
pacman -Syu
pacman -Fy
DIFFPROG=meld pacdiff
pacman -Qm
pacman -Qdt
If I’m in error, please correct, but otherwise I don’t want to take the focus off the OP. I hope the discussion was of value.