Ubuntu Tech Snippet #4 – Set default applications

A very useful thing is being able to set default applications. Quite often you may install a replacement for a default program, but the default application may still get opened when you try to open the file types that were associated with it. Of course, you can always right-click and then select Open With. However, this can be pain when you have to do it all the time just to open the file with the correct program.

So, I’m going to show you how to set a default application, just in case you didn’t already know.

Setting the default applications

Doing this is really quite easy. It requires all of 3 steps to get to the basic settings you can change.

Step 1: Open up System Settings

system settings

Ubuntu System Settings – Select the Details option

Step 2: Select Details. I use the Numix Circle icon set with the Numix theme instead of the defaults, so my system may look slightly different. However, the images are similar and the caption is the same, so just follow the name I give.

system details

Ubuntu System Details – This is the Window that should pop up

Step 3: Select the Default Applications menu option. From here you can select default applications for Web (Internet Browser), Mail (e-mail), Calender (exactly that), Music (again, exactly that), Video (whattaya-know! Exactly that again!), and Photos (yup. You guessed it. Exactly that.)

system details - default software

Ubuntu System Details – Default Software Options


Default application for removable media

From the same window as above, you can change what software opens (if any) when removable media is inserted (USB, CD, DVD, etc.)

system details - removable media

Ubuntu System Details – Removable Media Options

Simply select the Removable media option and go from there!

File associations

While the first options tell the system what software to launch when certain things are requested of it (like a web link a PDF being clicked or an e-mail address clicked on,) and the second provides removable media options, there is another way to change the default software associated with a certain file type. To do this you should right-click on the file of the type you want to change and select Properties at the bottom of the menu.

Right-click on files to bring up this menu - Select the Properties menu item

Right-click on files to bring up this menu – Select the Properties menu item

Select the Open with tab and then select the application you want this file type to be associated with.  Once the item is selected, click on the Set as default button to lock in your choice.

file type associations

Select the program you want to be used by default – Click Set as default to confirm

Update Alternatives – Geek alert!

There is one final way you can set defaults, and that is via the update-alternatives command. This command has control over every single changeable default in the system, including ones that most people won’t use. With great power comes great responsibility, or rather the chance to really mess up your system in this case. Be very careful what options you change, and write down which ones you did if you use this command, as there are a lot of options you can change.

Ubuntu uses the update-alternatives system it inherited from Debian to control default applications outside of the graphical desktop. For example, when you run a command that uses a terminal text editor, the command calls /usr/bin/editor./usr/bin/editor isn’t an editor itself – it’s a symbolic link to an editor on your system. This link points to the nano text editor by default, but you can select a different default text editor with the update-alternatives command. If only one option is available for an alternative – for example, if you only have one Java virtual machine installed – it will be used as the default.

Let’s say you want to change your web browser. You would then enter

sudo update-alternatives --config gnome-www-browser
update-alternatives gnome-www-browser

Update Alternatives in Terminal – Changing the default web browser

then you can select whichever option you wish, or, if you decide you want to keep it the same, just press Enter without entering any number.

Now, the names are a bit complicated to remember, as you can see with having to enter gnome-www-browser just to change the web browser, so you can see a list of all the changeable defaults. Just enter

sudo update-alternatives --all

You can go through, pressing enter to keep the same choice until you find the option you wish to change. Remember, be careful.

That’s all for this Tech Snippet. Hope you found it helpful and remember to comment down below with any snippets of your own, related or not to this post!

Tagged , ,

Tell us what you thought!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

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

%d bloggers like this: