I have an installed debian package, upgraded many times, and the permissions on the included files are questionable. I probably changed them at some point.

How do I figure out what the original permissions were/what they should be? I know that dpkg -L will list the files, but that listing does not include the permissions. I don't have a spare machine to test on, or this would be very simple.

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

Use the 'dpkg -c' command to show the contents of the original archive. You should have the latest version of the package in /var/cache/apt/archives. You can retrive the .deb if you don't have it in your archives directory with aptitude download.

aptitude download <some_package>
dpkg -c some_package.deb

For example using the grep command (output truncated, you'll get the idea :)).

$ aptitude download grep
...
Get:1 http://us.archive.ubuntu.com karmic/main grep 2.5.4-4 [224kB]
$ dpkg -c grep_2.5.4-4_i386.deb 
drwxr-xr-x root/root         0 2009-04-28 05:03 ./
drwxr-xr-x root/root         0 2009-04-28 05:03 ./usr/
drwxr-xr-x root/root         0 2009-04-28 05:03 ./usr/bin/
-rwxr-xr-x root/root        30 2009-04-28 05:02 ./usr/bin/rgrep

The paths listed are relative to /, of course.

link|improve this answer
excellent. Thanks! – TREE Sep 9 '09 at 12:10
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.