How to Install Sublime on Ubuntu 20.04

Sublime Text is a popular text editor among developers due to its simplicity, speed, and powerful features. It is available for multiple platforms, including Ubuntu 20.04. If you are new to Ubuntu or want to switch to Sublime as your default text editor, this blog post will guide you through the process of installing Sublime on Ubuntu 20.04.

Video Tutorial:

The Challenge of Installing Sublime on Ubuntu 20.04

Installing Sublime on Ubuntu 20.04 can be a bit tricky for beginners. Unlike other applications, Sublime is not available in the default Ubuntu repositories. Therefore, you need to set up a third-party repository to install Sublime. This challenge often leads to confusion and difficulties for users who are not familiar with the process.

Things You Should Prepare for

Before diving into the installation process, there are a few things you should prepare to ensure a smooth experience. Here is a checklist of what you need:

1. An Ubuntu 20.04 machine: Ensure that you have a working Ubuntu 20.04 installation to proceed with the Sublime installation.

2. Internet connection: Make sure you have a stable internet connection as the installation requires downloading files from the internet.

3. Access to root or user with sudo privileges: You need either root access or a user with sudo privileges to install Sublime and make system-wide changes.

Now that you have everything ready, let’s move on to the installation process.

Method 1: Installing Sublime via the Terminal

Installing Sublime via the terminal is the most straightforward method. It requires using the command line, but don’t worry, it’s not as complicated as it may sound. Here are the steps to install Sublime using the terminal:

Step 1: Open the terminal
To open the terminal, press Ctrl+Alt+T on your keyboard. This will launch the terminal window.

Step 2: Add Sublime’s GPG key
In the terminal window, copy and paste the following command, and press Enter:
“`bash
wget -qO – https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add –
“`

Step 3: Enable the apt package manager for https sources
Next, copy and paste the following command into the terminal, and press Enter:
“`bash
echo “deb https://download.sublimetext.com/ apt/stable/” | sudo tee /etc/apt/sources.list.d/sublime-text.list
“`

Step 4: Update the package list and install Sublime
To update the package list and install Sublime, run the following commands one by one:
“`bash
sudo apt update
sudo apt install sublime-text
“`

That’s it! Sublime is now installed on your Ubuntu 20.04 machine.

Now, let’s take a look at the pros and cons of using this method.

Pros Cons
Simple and straightforward Requires command line knowledge
Installation from official Sublime repository Does not always have the latest version
Easy to update and uninstall

Method 2: Installing Sublime via the Ubuntu Software Center

If you are not comfortable using the terminal, you can also install Sublime through the Ubuntu Software Center. Follow these steps:

Step 1: Open Ubuntu Software Center
Click on the Ubuntu Software Center icon on the left side of the Ubuntu dock.

Step 2: Search for Sublime
In the search bar at the top right corner of the screen, type “Sublime.” The Ubuntu Software Center will display the available packages.

Step 3: Install Sublime
Click on the “Install” button next to the Sublime Text package. You may be prompted to enter your password or verify the installation.

Once the installation is complete, Sublime is ready to use.

Here are the pros and cons of using this method:

Pros Cons
No command line knowledge required May not have the latest version
Easier for beginners Installation from a different repository
Updates provided through Ubuntu Software Center

Method 3: Installing Sublime Manually

If you prefer to have more control over the installation process or want to use a specific version of Sublime, you can choose to install it manually. Here’s how:

Step 1: Download the Sublime package
Go to the official Sublime website (https://www.sublimetext.com/) and download the Linux tarball for Sublime Text.

Step 2: Extract the downloaded file
After the download is complete, navigate to the location where the tarball is saved. Right-click on the file and select “Extract here” to extract its contents.

Step 3: Move the extracted folder
Move the extracted folder to the desired location. For example, you can move it to the /opt directory for system-wide installation.

Step 4: Create a symbolic link
To make Sublime easily accessible from the terminal, create a symbolic link. Open the terminal and run the following command, replacing “sublime_text” with the appropriate folder name:
“`bash
sudo ln -s /opt/sublime_text/sublime_text /usr/bin/sublime
“`

That’s it! You have successfully installed Sublime manually.

Here are the pros and cons of this method:

Pros Cons
Allows for more control over the installation process Requires manual downloading and extraction
Can install specific versions of Sublime No automatic updates
Flexible installation location

Method 4: Using Snap to Install Sublime

Snap is a universal package manager for Linux distributions, including Ubuntu. If you prefer to use Snap instead of the traditional package management system, you can install Sublime using Snap. Follow these steps:

Step 1: Open the terminal
Press Ctrl+Alt+T to open the terminal window.

Step 2: Install Snapd
Run the following command in the terminal to install Snapd if it is not already installed:
“`bash
sudo apt install snapd
“`

Step 3: Install Sublime
To install Sublime using Snap, run the following command:
“`bash
sudo snap install sublime-text –classic
“`

That’s it! Sublime is now installed on your Ubuntu 20.04 machine using Snap.

Here are the pros and cons of using this method:

Pros Cons
Easy installation through Snap package manager Requires Snapd and the Snap store
Automatic updates through Snap May not have the latest version available
Fast and reliable installation process

Why Can’t I Install Sublime?

Sometimes, when trying to install Sublime on Ubuntu 20.04, you may encounter certain issues. Here are some common reasons why you may not be able to install Sublime and their fixes:

1. Conflict with conflicting packages
– Fix: Remove conflicting packages or resolve dependencies manually.

2. Internet connectivity issues
– Fix: Check your internet connection and try again.

3. Incorrect package sources or repositories
– Fix: Verify the package sources or repositories and make corrections if necessary.

Additional Tips

Here are some additional tips to enhance your Sublime experience on Ubuntu 20.04:

1. Install package control: Package Control is a package manager for Sublime that allows you to easily install and manage additional packages. Open Sublime, press `Ctrl+` “` ` “`, and follow the instructions on the package control website to install it.

2. Customize your settings: Sublime allows for extensive customization. Open Sublime, go to “Preferences” > “Settings” and modify the settings according to your preferences. You can change themes, fonts, and various other options.

3. Learn keyboard shortcuts: Sublime has a vast array of keyboard shortcuts that can greatly improve your productivity. Take some time to learn and use the most commonly used shortcuts for editing, navigating, and searching.

5 FAQs about Installing Sublime on Ubuntu 20.04

Q1: Can I install Sublime on other Linux distributions?

A: Yes, Sublime is available for other Linux distributions as well. The installation process may vary slightly, but the general steps should be similar.

Q2: How do I update Sublime to the latest version?

A: The update process depends on the installation method you used. If you installed Sublime using the terminal, you can update it with the following command:
“`bash
sudo apt update
sudo apt upgrade sublime-text
“`
For other installation methods, refer to the respective update instructions.

Q3: Can I use Sublime for programming languages other than Python?

A: Yes, Sublime supports a wide range of programming languages. It offers syntax highlighting, code completion, and various other features for popular programming languages like JavaScript, HTML, CSS, Java, and more.

Q4: How do I uninstall Sublime?

A: The uninstallation process depends on the installation method you used. To uninstall Sublime installed via the terminal, run the following command:
“`bash
sudo apt remove sublime-text
“`
For other methods, refer to the respective uninstallation instructions.

Q5: Can I use Sublime as the default text editor on Ubuntu?

A: Yes, you can set Sublime as the default text editor on Ubuntu. Right-click on a text file, select “Properties,” go to the “Open With” tab, and choose Sublime Text from the list. Finally, click on the “Set as default” button.

In Conclusion

Installing Sublime on Ubuntu 20.04 might seem challenging at first, but with the right guidance, it can be done easily. In this blog post, we discussed four different methods to install Sublime on Ubuntu 20.04: via the terminal, Ubuntu Software Center, manual installation, and using Snap. Each method has its pros and cons, allowing you to choose the one that best suits your needs.

Additionally, we provided tips to enhance your Sublime experience and answered some common FAQs related to Sublime installation. Now that you have Sublime up and running, you can enjoy its powerful features and customize it according to your preferences.

Remember, Sublime is just one part of the development environment, and it’s essential to explore other tools and packages that can further improve your coding workflow. Happy coding!{“@context”:”https://schema.org”,”@type”:”FAQPage”,”mainEntity”:[{“@type”:”Question”,”name”:” Can I install Sublime on other Linux distributions?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:” Yes, Sublime is available for other Linux distributions as well. The installation process may vary slightly, but the general steps should be similar.”}},{“@type”:”Question”,”name”:” How do I update Sublime to the latest version?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:” The update process depends on the installation method you used. If you installed Sublime using the terminal, you can update it with the following command:”}},{“@type”:”Question”,”name”:” Can I use Sublime for programming languages other than Python?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:” Yes, Sublime supports a wide range of programming languages. It offers syntax highlighting, code completion, and various other features for popular programming languages like JavaScript, HTML, CSS, Java, and more.”}},{“@type”:”Question”,”name”:” How do I uninstall Sublime?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:” The uninstallation process depends on the installation method you used. To uninstall Sublime installed via the terminal, run the following command:”}},{“@type”:”Question”,”name”:” Can I use Sublime as the default text editor on Ubuntu?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:” Yes, you can set Sublime as the default text editor on Ubuntu. Right-click on a text file, select “Properties,” go to the “Open With” tab, and choose Sublime Text from the list. Finally, click on the “Set as default” button.”}}]}