Install and get started with Sublime on Ubuntu 22.04

Sublime Text is a text editor for writing the codes of different programming languages like Python and C programming and is also used to compile and debug them. The Sublime text has been updated with new features like the menu bar, a sidebar is introduced which help you to navigate to any line of the code, support for many programming languages is introduced, the autocorrect feature has been improved, and the API of Sublime text has been updated to the Python 3.8.

The Sublime Text is available for Windows, macOS, and different distributions of Linux, in this write-up, we will discover different methods of installing the Sublime Text on Ubuntu 22.04.

How to install the Sublime on Ubuntu 22.04

There are three main methods by which we can install the Sublime text on the Ubuntu using the command-line interface:

  • By adding the Sublime Text repository
  • From the snapcraft
  • From the flathub

Method 1: Installation of the Sublime text on Ubuntu 22.04 By adding the Sublime Text repository

First, we will import the GPG key of the Sublime text from its official website and add it in the repository of the Ubuntu:

$ wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
how to handle linux files and direc...

Then we will add the repository of the Sublime Text in the list of default repositories of the Ubuntu using the command:

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

After adding the repository, we will update the all the packages of the Ubuntu’s repository:

$ sudo apt update

Now, we will install the Sublime Text:

$ sudo apt install sublime-text -y

To confirm the installation, we will check the version of the installed Sublime-text using the command:

$ subl --version

To remove the Sublime-text from the Ubuntu, we will use the apt package manager with the purge command:

$ sudo apt purge sublime-text -y

Method 2: Installation of the Sublime text on Ubuntu 22.04 from the snapcraft

Second method of installing the Sublime text on the Ubuntu is by downloading the snap of the Sublime text from the snapcraft and installing it on the Ubuntu. For this purpose, we will require a snapd utility:

$ sudo apt install snapd -y

When the snapd utility is installed, we will install Sublime-text using it:

$ sudo snap install sublime-text --classic

To remove the snap of the sublime text using the snap utility:

$ sudo snap remove sublime-text

Method 3: Installation of the Sublime text on Ubuntu 22.04 from the flathub

Last method to install the Sublime text on Ubuntu is downloading and installing the sublime text package from the flathub by using the flatpak utility which can be installed on Ubuntu using the command:

$ sudo apt install flatpak -y

To download and install the sublime text package from the flathub:

$ flatpak install flathub com.sublimetext.three

After the installation is complete, go to the Application Menu’s search bar, then type the “sublime” and click on the “Sublime Text”:

A black screened text editor has been opened:

Some other shortcut keys with their applications are explained below:

Shortcut keyApplications
CTRL+DThis is used to select the words of the text file by placing the cursor on the specific word
Shift+F11This is used to hide all the distracting elements like the menu bar, sidebars, and the status bar
Ctrl+RThis is used to navigate to the specific symbol
Ctrl+PTo search and navigate to any file

Conclusion

The sublime text is the text editor for writing the codes of different programming languages and now it can also be run on the architectures like Raspberry Pi. In this write-up, we have discussed different methods of installing the Sublime Text on the latest release of Ubuntu 22.04.