Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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 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.

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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