dh_installmime - Linux


dh_installmime is a Debian package build tool used to generate MIME-type files during Debian package building. It inspects header files and creates corresponding MIME-type files in the /usr/share/mime/packages directory.


dh_installmime [debhelper options] [--sourcedir=<sources_directory>] [--nodoc] [--all] [--mime=<mime-file>]


  • –sourcedir=<sources_directory>: The directory containing the source code.
  • –nodoc: Do not generate any documentation files.
  • –all: Generate MIME-type files for all files in the source directory.
  • –mime=: Specify a custom MIME-type file to generate.


Basic usage:


Generating MIME-type files for all files:

dh_installmime --all

Generating MIME-type files for a specific file:

dh_installmime --mime=/usr/share/mime/packages/mycustom.mime

Common Issues

Missing dependencies:

You may encounter errors if the following dependencies are not installed:

  • debhelper
  • file

Incorrectly formatted MIME-type file:

Make sure that the MIME-type file follows the correct format and syntax.


Integration with Debian package build process:

dh_installmime is typically integrated into the Debian package build process using the debian/rules file.

Example usage in debian/rules:

        dh_installmime --all

Related Commands

  • update-mime-database