Build a local package repository

  1. Put all the packages in a directory
  2. Execute the following command (replace <dir> with the directory that holds the packages):
    dpkg-scanpackages <dir> /dev/null | gzip > <dir>/Packages.gz
  3. Add in /etc/apt/sources.list:
    deb file:<dir> ./

Determine the Debian package a file belongs to

If the file is present in your system, then use the following command:

dpkg -S <file>

If the file is not in your system (the package is not installed), then use apt-file:

  1. Install apt-file package:
    apt-get install apt-file
  2. Create/update the apt-file database:
    apt-file update
  3. Search for the package:
    apt-file search <file>