Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
I know this doesn't help, but I really doubt that it is possible as it would require a huge DB of MIME-types. I might be wrong though. – MiJyn Nov 30 '12 at 17:07
@MiJyn Why wouldn't it be feasible to query a large database of MIME-types? – Anderson Green Nov 30 '12 at 17:13

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


First gpk-install-mime-type confirmation dialog

Dialog listing applicable packages

share|improve this answer
It looks like you posted the same answer to two separate questions:… – Anderson Green Nov 30 '12 at 21:17
I know. I realise they're different questions, but this answer is useful for both of them. I'm not sure what the policy is on copying and pasting like this. – Flimm Nov 30 '12 at 21:20
Here is a relevant discussion relating to this issue:… – Anderson Green Nov 30 '12 at 21:22

My guess is you would need to compile the information yourself. You would need to compile the file types and associations with programs in the package manager. A lengthy task, but I'd be happy to help. Sounds like a worth while project. We could even open source the task and get others to help. You can go to my site and send me an email from the contact form.

Other then that known file types are stored internally in most linux distros to a smaller degree. Here is a question that addresses that Where are file associations stored?

share|improve this answer
Which package manager are you referring to specifically? – Anderson Green Nov 30 '12 at 20:09
apt-get is the package manager I use and theoretically you could probably set it up to work with other package managers and distros, but it might be more work. – Goddard Nov 30 '12 at 20:12
Here's a relevant question:… – Anderson Green Nov 30 '12 at 20:28
There's a program called PackageKit that you can use to obtain a list of programs for a specific mime type: – Anderson Green Nov 30 '12 at 21:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.