How to Install Sublime Text Editor on Ubuntu 18.04

Suraj Joshi Mar 14, 2025 Linux Ubuntu
  1. Step 1: Update Your System
  2. Step 2: Install the GPG Key
  3. Step 3: Add the Sublime Text Repository
  4. Step 4: Update Package List Again
  5. Step 5: Install Sublime Text
  6. Conclusion
  7. FAQ
How to Install Sublime Text Editor on Ubuntu 18.04

Installing a powerful text editor can significantly enhance your coding experience. Sublime Text is a popular choice among developers for its speed and flexibility. If you’re using Ubuntu 18.04, you’re in luck! Installing Sublime Text on your system is a straightforward process using the apt command-line tool.

This guide will walk you through the steps to get Sublime Text up and running so you can start coding right away. Whether you’re a seasoned developer or just starting, this article will provide you with everything you need to know to install Sublime Text on your Ubuntu machine.

Step 1: Update Your System

Before installing any new software, it’s always a good idea to ensure your system is up to date. This can prevent any compatibility issues down the line. To update your system, open your terminal and run the following commands:

sudo apt update
sudo apt upgrade

This will refresh your package lists and install any available updates.

Output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Updating your system ensures that you have the latest security patches and software versions. Once the update process is complete, you can proceed to install Sublime Text.

Step 2: Install the GPG Key

Sublime Text packages are signed with a GPG key to ensure their authenticity. You need to add this key to your system before installing the software. Use the following command in your terminal:

wget -qO - https://download.sublimetext.com/sublimehq.gpg | sudo apt-key add -

This command downloads the GPG key and adds it to your system. It’s a crucial step that helps your system verify the packages you will be installing. After adding the key, you can move on to adding the Sublime Text repository.

Step 3: Add the Sublime Text Repository

Next, you need to add the Sublime Text repository to your system’s software sources. This allows you to download and install Sublime Text directly from the official repository. Run the following command:

echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

Output:

deb https://download.sublimetext.com/ apt/stable/

This command creates a new list file for Sublime Text in your sources directory. By doing this, you ensure that your package manager knows where to find Sublime Text when you request it for installation. Now that the repository is added, you can update your package list again.

Step 4: Update Package List Again

After adding the Sublime Text repository, you need to update your package list to include the new repository. Use the following command:

sudo apt update

Output:

Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:4 https://download.sublimetext.com stable InRelease

This command refreshes your package list, incorporating the Sublime Text repository you just added. Now you’re ready to install Sublime Text.

Step 5: Install Sublime Text

With everything set up, installing Sublime Text is just a single command away. Run the following command:

sudo apt install sublime-text

Output:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  sublime-text
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 10.4 MB of archives.
After this operation, 30.4 MB of additional disk space will be used.

This command installs Sublime Text on your Ubuntu 18.04 system. The package manager will handle all dependencies and ensure that everything is in place. Once the installation is complete, you can launch Sublime Text from your applications menu or by typing subl in your terminal.

Conclusion

Installing Sublime Text on Ubuntu 18.04 is a simple and efficient process. By following these steps, you can quickly set up one of the most versatile text editors available. With its sleek interface and powerful features, Sublime Text will undoubtedly enhance your coding productivity. Whether you’re writing code, editing text files, or managing projects, Sublime Text is a fantastic tool to have in your arsenal. Enjoy coding with your new editor!

FAQ

  1. How do I launch Sublime Text after installation?
    You can launch Sublime Text by searching for it in your applications menu or by typing subl in the terminal.

  2. Can I install Sublime Text on other versions of Ubuntu?
    Yes, Sublime Text can be installed on various versions of Ubuntu. Just ensure you follow the appropriate installation steps for your version.

  3. Is Sublime Text free to use?
    Sublime Text offers an unlimited trial, but you will be prompted to purchase a license for continued use.

  4. How can I uninstall Sublime Text?
    To uninstall Sublime Text, run the command sudo apt remove sublime-text in your terminal.

  5. Are there any alternatives to Sublime Text?
    Yes, there are several alternatives, including Visual Studio Code, Atom, and Notepad++. Each has its unique features and benefits.

Enjoying our tutorials? Subscribe to DelftStack on YouTube to support us in creating more high-quality video guides. Subscribe
Author: Suraj Joshi
Suraj Joshi avatar Suraj Joshi avatar

Suraj Joshi is a backend software engineer at Matrice.ai.

LinkedIn