Ubuntu – Get downloadable applications that can open a specific file type

software-center

I'm trying to create a custom "open with" dialog that allows the user to open a file with a not-yet-installed application. In Ubuntu, is it possible to obtain a list of programs that can be used to open a file? I need to find a list of downloadable programs (instead of installed programs) that can open a file, from the command line.

Best Answer

PackageKit allows you to search for applications by mime-type. Sadly, the Ubuntu devs haven't put much effort into integrating PackageKit with Ubuntu by default, but it still works surprisingly well.

First, make sure you've installed the graphical toolkit for PackageKit, gnome-packagekit-tools Install gnome-packagekit-tools.

Then, run gpk-install-mime-type on the command line, followed by a mime-type. For example:

gpk-install-mime-type text/plain

Screenshots:

First gpk-install-mime-type confirmation dialog

Dialog listing applicable packages

Related Question