From Knoppix Documentation Wiki
Revision as of 04:45, 20 July 2006 by PeterChubb (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

To find what package a file belongs to I created the following script.

  • There may be a quicker way to do this, please feel free to inform if you find it.
    • There is: either use
   dpkg -S filename

or if you have it installed,

   dlocate filename

Ensure you are root, and run the following commands

cat > /usr/bin/whichpkg << EOF
echo checking for $1

for package in `dpkg -l | awk '{print $2}'`
  for file in `dpkg --listfiles $package 2> /dev/null`
    if echo $file | grep $1
      echo The file is from $package
chmod 755 /usr/bin/whichpkg

Now that the script is in place, to find the file simply use the command

whichpkg filename

For example, to find out whatpackage /etc/init.d/knoppix-autoconfig comes from you tupe

whichpkg knoppix-autoconfig

This takes some time as it searches everypackage for the result. Hope this helps.

SNIa 03:34, 8 Jul 2006 (GMT)