Change Default Apps on Linux: A Quick Guide for System Customization

Coby Carson

Linux Command Line

Linux users often want to change their default apps. This can make their computer work better for them. You can change default apps on Linux in a few easy ways.

On Ubuntu you can use the System Settings menu to pick new default apps. This works for things like web browsers email clients and media players. For other file types you can right-click a file and choose a new app to open it.

Some Linux users like to use the terminal to change default apps. This can give more control. But the graphical way is simpler for most people. Either way changing default apps lets Linux users set up their system just how they like it.

Understanding Default Applications in Linux

Linux uses default apps to open files. These apps can be changed to fit user needs. Default apps matter for everyday tasks and system functions.

Role of Default Applications

Default apps handle specific file types in Linux. They open when you click a file. For example a PDF file might open in a PDF reader. Default apps also run system tasks. The default web browser opens links from other programs.

Linux uses MIME types to link file types with apps. MIME types are labels that describe file contents. The system checks MIME types to pick the right app for each file.

Users can set their own default apps. This lets them use their favorite programs. It also helps when the built-in defaults don’t work well.

Common File Types and Associated Applications

Linux has default apps for many file types. Here are some examples:

  • Text files: gedit or nano
  • Images: GIMP or Eye of GNOME
  • Music: Rhythmbox or VLC
  • Videos: VLC or Totem
  • Web pages: Firefox or Chrome

These apps can vary based on the Linux version. Users can change default apps to fit their needs. For instance someone might prefer GIMP over the basic image viewer.

File managers in Linux often let users pick default apps. Right-clicking a file shows “Open with” options. This makes it easy to try different apps for each file type.

Changing Default Applications via GUI

Linux systems offer easy ways to change default apps through the graphical user interface. Users can set their preferred programs for various file types and tasks without using the command line.

Using Ubuntu’s System Settings

Ubuntu’s System Settings provide a simple method to change default apps. To access this:

  1. Click the gear icon in the top right corner
  2. Select “Settings”
  3. Choose “Default Applications”

Here you can pick default apps for:

• Web browser
• Email client
• Calendar
• Music player
• Video player
• Photos

Click the dropdown menu next to each category. Pick the app you want to use. The change takes effect right away.

Preferred Applications in GNOME

GNOME desktop users can set default apps through the Preferred Applications tool. This works on many Linux distributions.

To use it:

  1. Open GNOME Settings
  2. Click “Details”
  3. Select “Default Applications”

You’ll see options for web, mail, calendar, music, video, and photos. Click each one to choose your preferred app. GNOME remembers these choices for future use.

Using ‘Open With’ Tab in File Properties

For specific file types, you can set defaults through the file manager. This method works in most Linux desktop environments.

Steps:

  1. Find a file of the type you want to change
  2. Right-click and select “Properties”
  3. Click the “Open With” tab

You’ll see a list of apps that can open this file type. Select your preferred app and click “Set as Default”. This sets the chosen app for all files with that extension.

Right-clicking on a file also shows an “Open With” menu. You can pick a different app from this list for one-time use.

Using the Command Line to Set Default Applications

Linux users can change default apps through the terminal. This method offers more control and works across different Linux systems.

The Update-Alternatives System

The update-alternatives system lets users manage default program versions. It’s useful for setting default text editors or web browsers.

To see available options for a program type:

sudo update-alternatives --config <program>

Replace with editor, x-www-browser, or other alternatives.

Pick the number of your preferred option and press Enter. This sets the new default.

To add a new alternative:

sudo update-alternatives --install <link> <name> <path> <priority>
is the command name (like /usr/bin/editor)
is the alternative name is the program’s location is a number to rank options

Setting Default Applications with XDG-MIME

XDG-MIME manages file type associations. It works with desktop environments that follow the XDG standard.

To set a default app for a file type:

xdg-mime default <application>.desktop <mime-type>

is the app’s name
is the file type (like text/plain)

To find a file’s MIME type:

file --mime-type -b <filename>

To see the current default for a MIME type:

xdg-mime query default <mime-type>

These commands help users set default applications quickly through the command line. They offer more power than graphical methods.

Default Applications for Specific File Extensions

Linux lets users pick which programs open different file types. This makes it easy to use your favorite apps for common tasks.

Configuring Individual File Associations

To set a default app for a file type:

  1. Find a file with the extension you want to change
  2. Right-click and select “Properties”
  3. Click the “Open With” tab
  4. Choose your desired app
  5. Click “Set as default”

This method works for most Linux systems. It’s quick and easy for one-time changes.

For some file types, you may need to add a new app to the list. Look for an option to “Show other applications” or “Add custom command”.

Editing Application Mime-Type Associations

For wider changes, you can edit mime-type settings:

  1. Open a terminal
  2. Type: xdg-mime default [app].desktop [mime-type]
  3. Replace [app] with the app name
  4. Replace [mime-type] with the file type

Example: xdg-mime default firefox.desktop x-scheme-handler/http

This sets Firefox as the default for web links.

You can find app .desktop files in /usr/share/applications. Mime-types are listed in /usr/share/mime/types.

To see current defaults, use: xdg-mime query default [mime-type]

These changes apply system-wide. They affect all new files of that type.

Advanced Management of Default Apps

Linux offers powerful tools to control which apps open different file types. Users can make changes through desktop settings or command line options.

The Role of Desktop Environments

Desktop environments like GNOME and KDE give users easy ways to set default apps. In GNOME, the Settings menu has a “Default Applications” section. Here users can pick apps for common tasks like web browsing and email. KDE has a similar setup in its System Settings.

These options cover basic needs. But they don’t always show every possible app choice. For more control, users may need to dig deeper into system files or use terminal commands.

MIME-Type Configuration Files

MIME types tell the system what kind of data a file contains. Each file type has its own MIME type. Linux uses these to decide which app should open a file.

Users can edit MIME type settings directly. This gives more control than desktop environment options. The files are in the ~/.config/mimeapps.list folder. Editing them lets users set any installed app as the default for a file type.

This method works for all file types. It’s useful when the normal settings don’t show the app you want to use.

Altering Default Apps via Terminal Arguments

The terminal offers the most control over default apps. The update-alternatives command is a key tool for this. It manages system-wide defaults for many programs.

To use it, open a terminal and type:

sudo update-alternatives --config <program-name>

Replace with the app you want to change. The system will show a list of options. Pick the number of the app you want to use.

This method works for text editors, web browsers, and many other app types. It’s a quick way to switch defaults without digging through menus or files.

Managing Default Apps for External Media

Linux lets you control how your computer handles external devices. You can set which apps open when you plug in CDs or USB drives. This makes using removable media easier and faster.

Auto-Play Settings for Removable Media

Ubuntu Linux gives users options for auto-play when they insert external media. To change these settings, go to the System Settings menu. Click on “Details” and then “Removable Media.” Here you’ll see choices for CDs, DVDs, and other devices.

For music CDs, you can pick a media player to start right away. Video DVDs can open in your chosen video app. You can also set actions for photos and software. If you don’t want anything to happen when you plug in a device, turn off auto-play.

These settings help you work faster. Your computer will know what to do as soon as you insert media.

Setting Defaults for Audio CDs and USB Drives

Changing default apps for USB drives is simple on Ubuntu. When you plug in a drive, right-click on its icon. Choose “Open With” and pick the app you want to use. Select “Remember this app” to make it the default.

For audio CDs, the process is similar. Insert a CD and right-click its icon. Pick your favorite music player from the list. Ubuntu will remember your choice for next time.

You can also set defaults through System Settings. Go to “Details” and then “Default Applications.” This menu lets you pick default apps for music, video, and photos.

Best Practices for Default Application Settings

Smart default app settings help Linux users work better. They make tasks easier and keep everything running smoothly.

Regularly Updating Default Applications

Linux users should update their default apps often. This keeps the system safe and adds new features. To update, open the terminal and type “sudo apt update” then “sudo apt upgrade”. These commands will get the latest versions.

Users can also check for updates in the software center. Look for a button that says “Check for Updates”. Click it to see if any new versions are ready.

It’s good to set up automatic updates. This way, the system will stay current without extra work. Go to System Settings and find the Updates section. Turn on the option for automatic updates.

Ensuring Smooth User Experience Across Updates

When default apps change, it can be confusing. To avoid problems, users should test new versions before setting them as default. They can do this by installing the app but not making it the default right away.

If a new version causes issues, users can switch back to the old one. The update-alternatives command helps manage different versions of apps. Type “sudo update-alternatives –config” followed by the app name to choose a version.

It’s smart to keep old versions installed for a while. This gives time to make sure the new one works well. If it does, then remove the old version to save space.

Alternatives to the Standard Applications

Linux users have many options beyond the default apps. They can find free open-source programs for almost any task. These new apps can replace the built-in ones on their system.

Exploring Open Source Alternatives

Linux has a wide range of open-source apps to pick from. These apps are free and often work just as well as paid ones. Users can find replacements for text editors, web browsers, and media players. Some popular choices include:

  • LibreOffice instead of Microsoft Office
  • GIMP for image editing
  • VLC for playing videos
  • Thunderbird for email

Many of these apps have active communities. This means they get regular updates and new features. Users can try out different apps to find the ones that fit their needs best.

Installing and Setting New Applications as Default

Changing default apps on Linux is easy. First, users need to install the new app they want to use. They can do this through their system’s app store or package manager.

After installing, they can set the new app as the default. Here’s how:

  1. Right-click on a file
  2. Choose “Properties”
  3. Go to the “Open With” tab
  4. Pick the new app
  5. Click “Set as Default”

This process may vary slightly based on the Linux version. Users can also change defaults through system settings. With these steps, they can customize their Linux setup to fit their needs.

Troubleshooting Default Application Issues

Default application settings can sometimes malfunction. This can lead to problems with file associations and MIME-type definitions.

Problems with File Associations

File associations link file types to specific apps. When these links break, files may open with the wrong program or not open at all. To fix this:

  1. Right-click the file
  2. Select “Properties”
  3. Click the “Open With” tab
  4. Choose the correct app
  5. Click “Set as Default”

If that doesn’t work, try updating the system’s mime database:

sudo update-mime-database /usr/share/mime

This command refreshes the database that manages file type associations.

Issues with MIME-Type Definitions

MIME-types tell the system how to handle different file formats. Problems here can cause apps to misread files. To check MIME-type settings:

  1. Open a terminal
  2. Type: xdg-mime query filetype [filename]
  3. Press Enter

This shows the MIME-type for that file. If it’s wrong, you can set it manually:

xdg-mime default [application].desktop [mime-type]

Replace [application] with the app name and [mime-type] with the correct MIME-type.

These steps can help fix most default application issues on Linux systems.

Special Considerations for Multimedia Files

Choosing the right apps for multimedia files is key on Linux. The best choices handle many file types and work well with your system.

Default Apps for Photos and Images

Linux offers many options for viewing and editing photos. Pinta works well for basic image editing. To set it as the default:

  1. Right-click an image file
  2. Select “Properties”
  3. Click the “Open With” tab
  4. Choose Pinta from the list
  5. Click “Set as default”

This method works for most Linux systems. Some photo managers can handle RAW files from cameras. Check if your chosen app supports the file types you use most.

Managing Defaults for Video and Music Files

For videos and music, VLC Media Player is a top choice. It plays almost any file type. To set VLC as your default:

  1. Open system settings
  2. Find “Default Applications”
  3. Look for “Video” and “Music”
  4. Select VLC from the dropdown menus

VLC can handle both video and audio files. This makes it a good all-in-one choice. Some Linux systems let you pick different apps for each file type. This is helpful if you prefer separate video and music players.

Remember to test your choices after setting new defaults. This ensures files open correctly in your chosen apps.

Frequently Asked Questions

Linux users often need to change default applications for various tasks. This process can differ between distributions and file types.

How do I set a default application for specific file types in Linux?

To set a default app for a file type in Ubuntu, right-click on a file and select Properties. Click the Open With tab. Pick the app you want and click Set as default.

What is the command to change the default browser in Ubuntu?

The command to change the default browser in Ubuntu is:

sudo update-alternatives --config x-www-browser

This opens a list of installed browsers. Type the number of your preferred browser and press Enter.

How can one modify the system-wide default applications in a Linux distribution?

System-wide default apps can be changed in the settings menu. In Ubuntu, go to System Settings > Details > Default Applications. Select the app type and choose from the list.

Is it possible to define a default program for opening files from the command line in Linux?

Yes, it’s possible. Use the ‘xdg-mime’ command:

xdg-mime default application.desktop mimetype

Replace ‘application.desktop’ with the app’s .desktop file and ‘mimetype’ with the file type.

Where can I find and edit the list of default applications in Ubuntu?

Ubuntu’s default applications list is in System Settings. Click Details, then Default Applications. Here you can change defaults for web, mail, calendar, music, video, and photos.

In CentOS 7, how does one update the default applications?

In CentOS 7, use the ‘alternatives’ command:

sudo alternatives --config program_name

Replace ‘program_name’ with the app you want to change. Select the new default from the list that appears.