How to Install Sublime Text on Ubuntu 24.04?


Sublime Text offers a distraction-free writing mode, a quick project switch feature, and the ability to simultaneously edit two locations in one file. The purpose of installing Sublime Text on Ubuntu 24.04 lies in its streamlined user interface, powerful editing features, and extensive language support which make it an ideal choice for developers. Its compatibility with Ubuntu 24.04 ensures users benefit from a stable and secure text editing environment, leveraging the latest software libraries and system updates.

This tutorial will explain different methods for installing Sublime Text on Ubuntu 24.04.

How to Install Sublime Text on Ubuntu 24.04?

Sublime Text is a powerful code editor that developers highly favor for its simplicity, speed, and efficiency. To install Sublime Text on Ubuntu 24.04, you can use several methods.

Let’s begin with the easiest one.

Method 1: Install Sublime Text on Ubuntu 24.04 Using Ubuntu Software Center (GUI)

The Snap package is the easiest method and ensures that Sublime Text stays up-to-date automatically. It’s also possible to install Sublime Text as a snap package via the Ubuntu Software Center/Snapcraft store or by using the snap command in the terminal.

To install Sublime Text on Ubuntu 24.04 using GUI, follow the below-mentioned steps:

Step 1: Open Ubuntu Software Center

First, users need to open the “App Center” application, (also known as Snap Store) which is Ubuntu’s default Software Center:

Step 2: Search Sublime Text

Once opened, use the search function to look for “sublime” and select the “Sublime Text” snap package from the dropdown list:

Step 3: Install Sublime Text

If it is available in the Software repository, simply click the “Install” button and enter the user password when prompted to authorize the installation:

Alternative: Install Sublime Text Using CLI

Users can also install the stable version of Sublime Text via CLI which enables classic confinement for full access to the system’s file system (necessary for a text editor):

sudo apt install snapd # Prerequisite
sudo snap install sublime-text --classic

Step 4: Launch Sublime Text

Once installed, users can launch Sublime Text from the “Show Applications” menu:

Remove/Uninstall Sublime Text

To remove/uninstall Sublime Text on Ubuntu 24.04, hit the “Uninstall” button by searching “sublime” in the search bar of the Software Center:

Using Terminal

To remove/uninstall Sublime Text on Ubuntu 24.04 using snap, use the “remove” utility by mentioning the “sublime-text” package name as below:

sudo snap remove sublime-text

That is all from the installation of a text editor using the snap package via CLI as well as GUI.

Method 2: Install Sublime Text on Ubuntu 24.04 Using Official Sublime Text Repository

In this method, use the terminal and add the Sublime Text repository to the system’s software sources. After adding the repository, install Sublime Text using the apt command.

To install Sublime Text on Ubuntu 24.04 using the official Sublime Text repository, follow the stated steps:

Step 1: Install the GPG Key

First, users need to import the repository’s GPG key through the “wget” command. It installs the keys on the system for installing the text editor:

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/sublimehq-archive.gpg > /dev/null

Step 2: Add Sublime Text Repository

Now, add the Sublime Text repository to the system’s software sources. It ensures the latest as well as a stable package of the sublime text editor:

echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list # For Stable Release
echo "deb https://download.sublimetext.com/ apt/dev/" | sudo tee /etc/apt/sources.list.d/sublime-text.list # For Developers Release

Step 3: Update Package Lists

Then, update package lists for the installation of Sublime Text from the official Sublime repository:

sudo apt update

Step 4: Install Sublime Text

To install Sublime Text on Ubuntu, use the “sublime-text” package name with the help of the “apt” command:

sudo apt install sublime-text

If users find any dependencies error, ensure they have the “apt-transport-https” package installed:

sudo apt install apt-transport-https

Step 5: Launch Sublime Text

Once the text editor is installed, users can launch it from the “Show Applications” menu or by typing the “subl” on the terminal:

With Sublime Text installed on Ubuntu 24.04, enjoy a smooth coding experience with features like Goto Anything, Multiple Selections, Command Palette, and a distraction-free writing mode.

Remove/Uninstall Sublime Text

To remove/uninstall Sublime Text on Ubuntu 24.04, use the “autoremove” option by mentioning the “sublime-text” package name as below:

sudo apt remove sublime-text # Remove Package Only

sudo apt purge sublime-text # Remove Package as well as dependent packages

sudo apt autoremove sublime-text # Remove Package Completely

Each method has its own set of steps and may require different levels of user permissions.

Method 3: Install Sublime Text on Ubuntu 24.04 Using Flatpak Package

Sublime Text 4 is not available as a Flatpak yet, but users can install Sublime Text 3 using Flatpak. Let’s follow the below steps:

Step 1: Install Flatpak

First, install the Flatpak daemon using the apt command:

sudo apt install flatpak

Step 2: Install Sublime Text

Then, install Sublime Text 3 using Flatpak by mentioning the Flathub repository as below:

flatpak install https://dl.flathub.org/repo/appstream/com.sublimetext.three.flatpakref

Step 3: Launch Sublime Text

Once the text editor is installed, users can launch it from the “flatpak” command by typing the “com.sublimetext.three” application id:

flatpak run com.sublimetext.three

That is all from the guide.

Conclusion

Installing Sublime Text on Ubuntu 24.04 is a straightforward process. To install Sublime Text on Ubuntu 24.04, open the “Software Center” and install “Sublime Text” by searching it in the search bar of the Software Center. Alternatively, users can install Sublime Text on Ubuntu 24.04 by adding the Sublime Text repository to the system’s software sources and installing it via the “sudo apt install sublime-text” command. Flatpak also offers to install Sublime 3 using the Flathub repository. This article has explained all available methods of installing Sublime text using CLI as well as GUI.

Print Friendly, PDF & Email
Categories