
I have a corrupt file and wish to find which package it belongs to. In rpm I would do: rpm -qf <file name with full path> What is the equivalent in dpkg etc?

Hi Allan On 21 December 2014 4:55:06 PM AEST, Allan Duncan <amd2345@fastmail.com.au> wrote:
I have a corrupt file and wish to find which package it belongs to.
In rpm I would do: rpm -qf <file name with full path>
What is the equivalent in dpkg etc?
dpkg -S {/path/to/file} Regards, Arjen.

On Sun, 21 Dec 2014 05:03:56 PM Arjen Lentz wrote:
dpkg -S {/path/to/file}
There's also dlocate: Description-en_AU: fast alternative to dpkg -L and dpkg -S Uses GNU grep and text dumps of dpkg's data to greatly speed up finding out which package a file belongs to (i.e. a very fast dpkg -S). Many other uses, including options to view all files in a package, calculate disk space used, view and check md5sums, list man pages, etc. -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC

On 21/12/14 18:03, Arjen Lentz wrote:
Hi Allan
On 21 December 2014 4:55:06 PM AEST, Allan Duncan <amd2345@fastmail.com.au> wrote:
I have a corrupt file and wish to find which package it belongs to.
In rpm I would do: rpm -qf <file name with full path>
What is the equivalent in dpkg etc?
dpkg -S {/path/to/file}
Regards, Arjen.
I tried that but got no match. The man page talks about not showing files created by maintainer scripts, which may be the case. The file I am chasing is: /var/lib/dpkg/info/hicolor-icon-theme.postinst

On Sun, 21 Dec 2014 07:36:29 PM Allan Duncan wrote:
I tried that but got no match. The man page talks about not showing files created by maintainer scripts, which may be the case. The file I am chasing is: /var/lib/dpkg/info/hicolor-icon-theme.postinst
That'll be the post install script for the hicolor-icon-theme package. cheers! Chris -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC

Hello Alan, Chris has made a very valid suggestion. On Sun, 2014-12-21 at 20:08 +1100, Chris Samuel wrote:
On Sun, 21 Dec 2014 07:36:29 PM Allan Duncan wrote:
I tried that but got no match. The man page talks about not showing files created by maintainer scripts, which may be the case. The file I am chasing is: /var/lib/dpkg/info/hicolor-icon-theme.postinst
That'll be the post install script for the hicolor-icon-theme package.
cheers! Chris
I checked for the file on a current Debian install, and it was there, but dpkg did not know where it came from. It is a relatively short and simple shell script, and I have attached a copy for you to compare. Others might have comment about how your copy varies from what it should be. Regards, Mark Trickett

On 21/12/14 21:28, Mark Trickett wrote:
Hello Alan,
Chris has made a very valid suggestion.
On Sun, 2014-12-21 at 20:08 +1100, Chris Samuel wrote:
On Sun, 21 Dec 2014 07:36:29 PM Allan Duncan wrote:
I tried that but got no match. The man page talks about not showing files created by maintainer scripts, which may be the case. The file I am chasing is: /var/lib/dpkg/info/hicolor-icon-theme.postinst
That'll be the post install script for the hicolor-icon-theme package.
cheers! Chris
I checked for the file on a current Debian install, and it was there, but dpkg did not know where it came from. It is a relatively short and simple shell script, and I have attached a copy for you to compare. Others might have comment about how your copy varies from what it should be.
Thankyou. I actually have a good copy on the other Pi, but I'm more interested in how to manage this stuff. Ultimately I will blow this system away with a clone of the other one - there were about 8 altered characters in the file, so what other corruptions exist on the file system? I've got my replacement SD card from Patriot's warranty system, so it is just a matter of doing the transfer.

On 21/12/14 19:36, Allan Duncan wrote:
The man page talks about not showing files created by maintainer scripts, which may be the case. The file I am chasing is: /var/lib/dpkg/info/hicolor-icon-theme.postinst
That file you are chasing is *part* of the package's scripts, which doesn't appear in `dpkg -L` lists at all. You should simply reinstall the package if you can -- `apt-get --reinstall install hicolor-icon-theme`. In case that doesn't work, and that file doesn't exist, just make it a dummy script: $ echo -e '#!/bin/sh\nexit 0' > /var/lib/dpkg/info/hicolor-icon-theme.postinst $ chmod +x /var/lib/dpkg/info/hicolor-icon-theme.postinst ...and try to reinstall the package once again. Apologies if I've misread anything as your question didn't make 100% clear exactly what the problem was.

On Sun, Dec 21, 2014 at 07:36:29PM +1100, Allan Duncan wrote:
The man page talks about not showing files created by maintainer scripts, which may be the case. The file I am chasing is: /var/lib/dpkg/info/hicolor-icon-theme.postinst
this is the post-install script for the hicolor-icon-theme package. you can reinstall the package with apt-get --reinstall install hicolor-icon-theme if this fails with an error message, you'll need to remove or purge the package before reinstalling it....and you'll probably need to 'rm -f /var/lib/dpkg/info/hicolor-icon-theme.prerm' first. craig -- craig sanders <cas@taz.net.au>
participants (6)
-
Allan Duncan
-
Arjen Lentz
-
Chris Samuel
-
Craig Sanders
-
Jeremy Visser
-
Mark Trickett