1 Title: Using appstream in Debian to locate packages with firmware and mime type support
5 <p>The <a href="https://wiki.debian.org/DEP-11">appstream system</a> is
6 taking shape in Debian, and one feature set that is very convenient is
7 its ability to tell you want package to install to get a given
8 firmware file. This can be done using apt-file too, but that is for
9 someone else to blog about. :)</p>
11 <p>Here is a small recipe to find the package with a given firmware
12 file, in this example I am looking for ctfw-3.2.3.0.bin, randomly
13 picked from the set of firmware announced using appstream in Debian
14 unstable. In general you would be looking for the firmware requested
15 by the kernel during kernel module loading. To find the package
16 providing the example file, do like this:</p>
19 % apt install appstream
23 % appstreamcli what-provides firmware:runtime ctfw-3.2.3.0.bin | \
24 awk '/Package:/ {print $2}'
29 <p>See <a href="https://wiki.debian.org/AppStream/Guidelines">the
30 appstream wiki</a> page to learn how to embed the package metadata in
31 a way appstream can use.</p>
33 <p>This same approach can be used to find any package supporting a
34 given MIME type. This is very useful when you get a file you do not
35 know how to handle. First find the mime type using <tt>file
36 --mime-type</tt>, and next look up the package providing support for
37 it. Lets say you got an SVG file. Its MIME type is image/svg+xml,
38 and you can find all packages handling this type like this:</p>
41 % apt install appstream
45 % appstreamcli what-provides mimetype image/svg+xml | \
46 awk '/Package:/ {print $2}'
70 <p>I believe the MIME types are fetched from the desktop file for
71 packages providing appstream metadata.</p>