[H-GEN] Checking file ownership on installed debian packages.
Russell Stuart
russell-humbug at stuart.id.au
Sat Oct 9 21:25:27 EDT 2010
On Sun, 2010-10-10 at 07:01 +1000, David Seikel wrote:
> I recall from my RPM days there was a command to check all installed
> packages, reporting any that had owner, group, or permissions that
> where different from what the package said they should be. It could
> also report checksum differences. Seems that in the debian world,
> there is only debsums for reporting checksum differences, which does
> not help with the metadata.
>
> Anybody got a cluebat to hit me with?
>From what I know of Debian and RPM, there is no easy way to do this.
RPM packages store the meta information (ie mode, user, group) in a
separate file which is retained on the system after you install the
package. In Debian that same information comes from the tar ball that
contains the files to be installed, and that tar ball is typically
removed from the system one the install is done.
So the simplest option is probably to reinstall the effected packages.
This isn't so hard. My first approximation would be something like
this:
sudo apt-get install --reinstall $(
find /directory/i/stuffed | xargs dpkg -S 2>/dev/null |
sed -e 's/:.*//' -e 's/ //g' | tr , '\n' | sort -u)
More information about the General
mailing list