How to Change Default Terminal in Ubuntu?
The terminal emulator is a crucial part of any Ubuntu user’s toolkit, providing direct access to the system’s command-line interface.
While Ubuntu comes with GNOME Terminal by default, it might not be the best fit for everyone. Some users prefer a terminal with more features, a better interface, or enhanced performance.
Ubuntu allows you to switch the default terminal emulator with ease, providing greater flexibility in how you interact with your system. For users who prefer a graphical interface, there are also GUI-based options like dconf-editor that make switching terminals straightforward, especially for GNOME users.
This tutorial covers two different methods to Change Default Terminal in Ubuntu:
- Using update-alternatives Tool.
- Using gsettings for GNOME Users.
In the end, you will have full control over which terminal emulator launches when you use shortcuts or context menus.
Prerequisites to Change Default Terminal in Ubuntu
To Change the Default Terminal Emulator in Ubuntu 22.04 & 20.04, your machine needs to meet all the below specifications:
- A Linux VPS running Ubuntu.
- A non-root user with
sudo
privileges. - Access to Terminal.
Method 1: Using update-alternatives Tool
This method is ideal for users who want to switch the default terminal emulator regardless of the desktop environment they are using.
Ubuntu’s update-alternatives
tool makes it easy to register and select a different terminal emulator.
Step 1: Install Your Preferred Terminal Emulator
Before setting a new default, install your preferred terminal.
Here, we’ll use Terminator as an example, but you can replace it with any other terminal you prefer.
sudo apt install terminator
Step 2: Find the Executable Path
After installing, locate the executable path for Terminator, which is required to set it as the default.
which terminator
The output will typically be something like /usr/bin/terminator
. Keep this path handy.
Step 3: Register New Terminal
To register Terminator as a terminal option in Ubuntu’s alternatives system, run the command below:
sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/terminator 50
Here, the number 50
represents the priority. You can change this number if you wish, but 50 works for most cases.
Step 4: List Available Terminal Emulators
Using the command below, you can check if Terminator has been successfully registered:
sudo update-alternatives --list x-terminal-emulator
Step 5: Select the Default Terminal
Finally, run the following command to manually configure your terminal by selecting the desired option from the list:
sudo update-alternatives --config x-terminal-emulator
You’ll see a list of terminals, and you can pick the number corresponding to Terminator or any other terminal you wish to use as the default.
Method 2: Changing the Default Terminal for GNOME Users with gsettings
If you are using the GNOME desktop environment, this method directly configures your default terminal using gsettings
.
Set the Default Terminal
Run the command below to switch to Terminator as your default terminal in GNOME:
gsettings set org.gnome.desktop.default-applications.terminal exec '/usr/bin/terminator'
This command overrides the default terminal and sets Terminator as the preferred terminal emulator.
That’s it! Switching the default terminal in Ubuntu is a simple yet effective way to optimize your workflow.
Test Your Default Terminal
Once you’ve made the changes, it’s important to verify that the default terminal has been correctly configured.
To do this, follow the below path:
- Press Alt + F2 and type
x-terminal-emulator
. This should launch the newly configured default terminal. - On GNOME, you can also right-click on the desktop and select Open Terminal to confirm the change.
How to Uninstall a terminal emulator?
To uninstall a terminal, use the following command:
sudo apt remove your-terminal
Make sure to reset the default terminal before removing it using update-alternatives
, or you may encounter issues with launching terminals.
To avoid losing terminal access after removing the current default, follow these steps:
1. Set another terminal as the default using the update-alternatives
tool:
sudo update-alternatives --config x-terminal-emulator
2. Proceed with the uninstallation of the terminal you wish to remove.
Reasons to Change Ubuntu Default Terminal
Changing the default terminal in Ubuntu can greatly enhance your experience, allowing you to tailor your system to your workflow.
While GNOME Terminal works well for many, alternatives like Terminator or Tilix offer features such as multi-pane views, advanced customization, or better resource handling.
If you often multitask, need specific tools, or simply prefer a more visually appealing interface, switching to a different terminal emulator can make your workflow smoother, more efficient, and enjoyable.
Introducing Some Popular Terminal Programs
Here’s a brief introduction to some good terminal emulator options for Ubuntu.
1. urxvt (rxvt-unicode):
It is a lightweight terminal emulator that’s a variant of rxvt, designed to be a more efficient alternatives to xterm. It supports Unicode and is ideal for those seeking a simple and fast terminal.
To install urxvt, run:
sudo apt install rxvt-unicode
2. Guake/Yakuake
Both of these are drop-down terminals inspired by the consoles in games like “Quake.”
They allow easy access to the terminal with a quick keystroke, disappearing when not in use. Guake is for GNOME, while Yakuake is for KDE users.
Use the command below to install Guake:
sudo apt install guake
3. Eterm
It was created for the Enlightenment window manager, Eterm is functional but hasn’t seen active development in a while. It’s still usable if you prefer a minimalist terminal.
Run the command below to install Eterm:
sudo apt install eterm
How to check which terminal is currently set as the default?
To check which terminal emulator is the default on your system, run the command below:
sudo update-alternatives --display x-terminal-emulator
This will show the currently selected terminal and available alternatives.
Why the new terminal I installed doesn’t appear in the update-alternatives list?
If the new terminal doesn’t automatically appear, run the command below to add it by using this command:
sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /path/to/terminal 50
Troubleshooting Common Issues on the Ubuntu terminal
Terminal not Launching After Change:
If your new terminal emulator doesn’t open after being set as the default, verify that it’s correctly registered in the alternatives system.
Ensure the executable path is accurate, and rerun:
sudo update-alternatives --config x-terminal-emulator
GNOME Terminal Reverting After Reboot:
If the terminal reverts to GNOME Terminal after reboot, this might indicate a configuration issue.
Verify that the gsettings
command was executed successfully, and that it persists across sessions by adding it to your startup scripts:
echo "gsettings set org.gnome.desktop.default-applications.terminal exec '/usr/bin/terminator'" >> ~/.bashrc
How to solve revert the Terminal to the default GNOME Terminal after a reboot?
This could happen if the terminal emulator you selected is not properly set in the alternatives system.
Ensure that you run the following command:
sudo update-alternatives --config x-terminal-emulator
and select the new terminal. After selecting it, reboot your system and check if the change persists.
How to change the default terminal in Ubuntu using graphical tools?
While some graphical desktop environments like GNOME allow you to change the default terminal using dconf-editor or gsettings:
For GNOME, run:
gsettings set org.gnome.desktop.default-applications.terminal exec '/usr/bin/your-terminal'
Replace /usr/bin/your-terminal
with the path to your preferred terminal.
How to revert to GNOME Terminal as the default?
If you want to revert to GNOME Terminal, use the following command:
sudo update-alternatives --config x-terminal-emulator
Then select GNOME Terminal from the list, typically located at /usr/bin/gnome-terminal
.
How to use different default terminals for different users?
The update-alternatives
command sets the default terminal system-wide.
For user-specific changes, you can adjust environment variables like TERM
or TERMINAL
in the user’s shell configuration file (~/.bashrc
or ~/.zshrc
):
To set a different terminal emulator for a specific user, modify their shell profile.
For example, add the following line to their ~/.bashrc
(or ~/.zshrc
for Zsh users):
export TERMINAL='/usr/bin/terminator'
This change will apply only to that user, ensuring each user can have their preferred terminal emulator.
Conclusion
In this article, we covered two different methods to change default terminal in Ubuntu.
Whether you prefer the flexibility of the update-alternatives
method or the quick GNOME-specific gsettings
approach, you can easily tailor your terminal environment to suit your needs
This customization not only enhances your productivity but also ensures that your system behaves exactly how you want it to in various contexts.