Why does Firefox try to use Gedit to open .deb files

I had this behaviour with Firefox too. It was opening PDFs, .DOCs, .DOCXs, etc with Gedit. Very annoying. Didn't matter than the Applications list in Firefox specified LibreOffice, Evince, etc., as the preferred application UNLESS I clicked on the 'Show All Downloads' link at the bottom of the downloads menu (in the firefox taskbar).

To fix this, I opened .local/share/applications/mimeapps.list and removed the association of application/octet-stream with gedit.desktop. Doing that restored the normal/expected behaviour.

This clearly highlights a bug in Firefox, which is that it sometimes uses its applications list, but not always (as of version 35.0.1 on Ubuntu 12.04).


Firefox also has its own application list. Check Preferences->Applications, then find the Debian files. It probably says "Always ask" next to it if you haven't changed anything. If you click on "Always ask" you can select "Use other" and pick the Ubuntu software center or Synaptic or whatever you'd like it to be (though unfortunately you will have to use the file finder to actually get to the application file, which can be a slight annoyance). The Ubuntu Software Center is in /usr/bin/software-center and gdebi can be found in /usr/bin/gdebi-gtk.


There are default programs xdg-open and gnome-open which automatically select appropriate tool for a file.

I managed to find out that its enough to change association for unknown type and everything works fine.

Solution

This is everything you need BEGIN

sed 's#.*octet-stream.*#application/octet-stream=gnome-open.desktop#' ~/.local/share/applications/mimeapps.list -i

END

I have got to this conclusion by using find, ubuntu-tweak- inotifywatch