Allow snaps to register new mime types?

snapd, when installing a snap, has some logic to parse desktop files and generate a mimeinfo.cache file that associates mime types to desktop files.

This allows e.g. a snapped app to advertise that it handles the application/x-foobarbaz mime type.

However there doesn’t seem to be a way for the snap to register application/x-foobarbaz as a new mime type (according to the shared-mime-info spec) so that it is recognized by the host system.

This would require invoking update-mime-database on a directory containing xml descriptions.

Are there any plans to add this functionality to snapd?


I recently wrote an app that requires this functionality. It needs to register a MIME type for a file type that is downloaded from a website. For this reason I was unable to distribute it as a Snap, and have to fall back to using a PPA. I’m sure there’s lots of other apps that would fall into this category that would benefit from being shipped as Snaps.

Has there been progress or updated plans in this area?

Flatpak has some logic that (presumably) allows for sane export of MIME types:

UX is not so great for apps that ship their own file format(s) at the moment.

Any news on this?

Do we have a bug open at least? I didn’t find one with a quick check

There wasn’t one, so I went ahead and filed bug #1849094.

1 Like