How to Install Sublime Text on Ubuntu 22.04 / Ubuntu 20.04

0

Sublime Text is a shareware, cross-platform source code editor created by Sublime HQ. It supports many programming languages natively, and you can extend its functionality by installing community-built plugins.

Sublime Text supports auto-completion, syntax highlighting, code building, snippets, installing themes, etc.

Here, we will see how to install Sublime Text on Ubuntu 22.04 / Ubuntu 20.04.

Install Sublime Text on Ubuntu 22.04/20.04

The Sublime Text editor is available from the Snap store and the official repository for Ubuntu.

Install Sublime Text from Official Repository

Sublime Text offers its package through the official repository for Ubuntu operating system. So, set up the Sublime Text repository in the system.

To do that, download and add the Sublime Text repository signing key to your system with the below command.

Ubuntu 22.04

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo gpg --dearmor -o /usr/share/keyrings/sublimetext-keyring.gpg

Ubuntu 20.04

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

Then, add the Sublime Text editor repository to your system.

Ubuntu 22.04

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/sublimetext-keyring.gpg] https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

Ubuntu 20.04

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

After adding the repository to your system, update the repository index.

sudo apt update

Finally, install Sublime Text with the below command.

sudo apt install -y sublime-text

Install Sublime Text from Snap Store

Sublime Text is available as snap packages from the Snap store, and you can install it with the below commands.

sudo snap refresh

sudo snap install sublime-text --classic

Launch Sublime Text Editor

After the successful installation of the Sublime Text, you can launch it by running the subl command in the terminal or by going to Activities >> search for Sublime Text.

Sublime Text on Ubuntu 22.04
Sublime Text on Ubuntu 22.04

Update Sublime Text on Ubuntu

You can follow the below steps to keep the Sublime Text updated when the update is available.

Update Sublime Text using Official Repository:

sudo apt update

sudo apt --only-upgrade sublime-text

Update Sublime Text using Snap Store:

sudo snap refresh sublime-text

Conclusion

That’s All. I hope you have successfully installed Sublime Text on Ubuntu 22.04 / Ubuntu 20.04.

You might also like