On Fri, 5 Jul 2019 at 14:18, Steve Mynott steve.mynott@gmail.com wrote:
dpkg -S doesn't use the network.
Sorry, my question was badly worded.
By offline I mean that I won't have the system booted, but will be looking at a backup of the files on a different computer.
(Eg: Remove SD card from Raspberry Pi, insert into my desktop (Ubuntu), and look at the files on the SD card to determine what packages were installed.)
The actual use case is to compare tarballs taken from multiple Pis to see what changes between archives. On a complete OS backup a lot of files will have changed, but the vast majority of them are OS files that can be accounted for by a handful of packages. So for example I don't want to know that one backup has /usr/bin/411toppm, /usr/bin/anytopnm, /usr/bin/asciitopgm, etc in it but the other doesn't, I want to say that the first backup had netpbm installed bu the second didn't. (netpbm is just one example: its .deb alone comprises 486 files, so installing it one unit creates 486 file differences that can be accounted for by that one package install; scale that up to an entire O/S...)
Since I've expanded on this I'll add: ideally I want to do as much as possible from just the file listing that I get from tar -jt to avoid extracting multi-GB files to do the comparison. Hence specifically wanting to map "/usr/bin/411toppm" to "netpbm" by the filename/path alone.