Set default programs in Ubuntu, Linux Mint, Debian (blue)

How to change the default application for a type of file on Linux

Last updated on October 10, 2022

This howto explains how to change the default program to open all files with a given extension on Linux Mint, Ubuntu, Debian, and most Linux distributions. It also details how to change the default application for a batch of filetypes, for example all audio files or all video files.

Set the default program for a given filetype

1. In Nemo / Nautilus / Caja, right-click on any file with the desired file type or extension, choose “Properties” from the context menu.

2. The “Properties” dialog appears. Click on the “Open With” tab.

3. Select the desired application for the given filetype. All files with the same extension will now be opened with this program by default.

Set the default program for a given file type / extension (Here a pdf document in Nemo on Linux Mint)

On Linux Mint, replace step one and two choosing “Open With” → “Other Application…” in the contextual menu, as seen in the picture above.

Change the default app for multiple filetypes

Changing the default application for one type of file is really easy, while changing a batch of file type associations reveals a little clumsier, but extremely efficient.

These instructions should work with a large spectrum of Linux flavours, please share your experience with your favorite distribution in the comments.

Associate all audio and video files to VLC instead of Totem media player (Movie Player)

Video files: .avi .mp4 .mpg .ogv .ogm .mkv .wmv etc. Audo files: .mp3 .ogg .flac .wav .wma etc.

Open defaults.list with gedit:
gksudo gedit /usr/share/applications/defaults.list

And replace all occurrences of totem with banshee/rythmbox/vlc or the media player of your choice. (Search → Replace → Replace All)

Changing MIME Types (File types) in Linux Mint / Ubuntu screenshot

Save the modified file, and you’re done! Change are effective immediately.

Associate all office documents to LibreOffice instead of OpenOffice.org or Abiword

Office files: .odt .ods. .doc .docx .xls .xlsx etc.

Open defaults.list with gedit:
gksudo gedit /usr/share/applications/defaults.list

And replace all occurences of “openoffice.org” with “libreoffice”. (Search → Replace → Replace All)

Finally, save the file. No need to restart, you’re all set!

Other file associations

Use the same technique to change the default application for all kind of file types or extensions, for example:

  • all pictures (.jpg, .png, .gif, etc.) should open up with gThumb instead of EOG/Eye of Gnome/Image Viewer
  • all html documents should open with Firefox instead of Chrome
  • all pdf files should open with Adobe Reader instead of Evince/Document Viewer.

Different solution for some Ubuntu versions

For an obscure reason, changing the file associations directly in the defaults.list doesn’t seem to work on some Ubuntu versions. Nevertheless, importing information to the the mimeapps.list works.

The file associations for each user are stored in:
~/.local/share/applications/mimeapps.list

In Ubuntu this file is almost empty. Let’s import informations from /usr/share/applications/defaults.list

Display all the video MIME types / Media types associations with this command:
cat /usr/share/applications/defaults.list | grep video

Append all the lines containing video types to the local file:
cat /usr/share/applications/defaults.list | grep video >> ~/.local/share/applications/mimeapps.list

Open defaults.list with gedit:
gedit ~/.local/share/applications/mimeapps.list

And replace all occurrences of totem with vlc (Search → Replace…) Proceed similarly for audio files if needed. Unlike the standard method described at the beginning of this article, this method permits to assign a separate program to audio or to video files.

By Johannes Eva, January 2011 – October 2022

This article has been linked on LXer.com, Linux Today and some more…

Articles by categories

Most Read Articles

Comments

10 thoughts on “AVIF browser test page: AVIF support in Chrome, Firefox, Edge…”

    1. Thank you for your interest – a JPEG XL test page would be useful, but I have no time left at the moment. Hopefully at some time in 2022 🙂

  1. Sadly your site need javascript enable for the test avif vs jpeg. If noscript bloc everything, this page say that AVIF is not supported and display JPEG fallback.
    In JS dependences there is also google-analytics that is not fair play for a libre-software website :(.

    Thank you for your article anyway.

    1. Actually, AVIF/JPEG fallback using the element is pure HTML and does not need Javascript, even on this site. And you’re right, I really should switch from GA to Matomo, it’s a matter of time. Cheers!

  2. Nice article. Love how you included a detailed tutorial for WordPress. I have created a UX optimized converter that support bulk conversion, without the need of uploading files. You can find it on: https://avif.io/

    The next update will include a settings panel on which you can edit the quality, effort and exif data.

    Feel free to add it to the converter list if you feel like it’s a great addition. Sincerely, Justin

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.