Change the Default Programs Using Ubuntu

Select default programs on Ubuntu using one of three methods

Directly Above Shot Of Default Text Made From Toy Blocks On Table
Roberto Pangiarella / EyeEm / Getty Images

Although most tasks in Linux are easier to perform from a shell prompt, the assignment of default applications within Ubuntu Linux (usually) makes much more sense from within your preferred desktop environment.

This procedure was performed on Ubuntu 19.10 using Budgie desktop environment, but the procedure is the same for all currently supported versions of Ubuntu running any officially supported DE.

How to Assign Ubuntu Default GUI Applications

ubuntu default applications

Ubuntu Linux supports six universal defaults—a web browser, an email client, a calendar, a music player, a video player, and a photo viewer.

Within the Settings app, click Details > Default Applications.

Assign each of the six universal defaults using relevant software installed on your computer. Add apps to the list by installing them, then re-launching the Settings app.

How to Assign Ubuntu Context-Specific Applications

set file properties in linux

Beyond the universal defaults, you're free to assign specific file types to specific applications. Within your DE's file manager, right-click on a file and select Properties. In the window that appears, find the equivalent of open with and from there, select an alternative application.

Click the equivalent of set as default to make that application the default for all files with the extension as the file you originally selected.

Each desktop environment handles this process in a different way. Consult your DE's manual for additional guidance.

How to Update Non-GUI Default Applications

linux alternatives editor

Run the command:

sudo update-alternatives --all 

to review a list of all system-identified universal defaults. This list goes well beyond the six basic categories listed in the Ubuntu Settings app. The update-alternatives command reviews all link groups and if more than one program can handle the app, then it lists a selection.

For example, there's no base Linux program called editor, but the program /usr/bin/editor links to some other editor installed on the computer. So when you run a text file, Linux invokes /usr/bin/editor and then whatever associated program happens to hard-link to it, opens. (This feature may seem silly in a single-user context, but in a scripting context, a developer's script will always run regardless of how any individual system may be configured.) In many cases on modern Ubuntu distributions, /usr/bin/editor actually references /bin/nano, so the Nano editor runs by default.