How to Install Sublime Text Editor on Ubuntu 20.04

As a coder, finding a text editor that works for you is critical. You’ll be spending tons of time working in it, so get cozy.

The formal definition is: “A text editor is a type of program used for editing plain text files.

Essentially, a text editor is a program on you computer that allows you to create and edit a range of programming language files. This is the place where you write your code!

In this article, we will discuss a text editor which is a favorite of developers and is my personal favorite. I’m talking about Sublime Text Editor.

Sublime is a amazing piece of software(text editor) which is widely used among developers.

It’s a clean, functional, and fast code editor. Not only does it have incredible built in features (multi-edit and vim mode), but it has support for plugins, snippets, and many other things.

It includes wide features such as Syntax Highlight, Auto Indentation, File Type Recognition, Sidebar, Macros, Plug-in and Packages that make it easy for working with code base.

Sublime Text contains 23 different visual themes, with the option to download additional themes and configure custom themes via third-party plugins.

Key Features of Sublime Text Editor:

  • Auto-Completion
  • Quickly Insert Text & Code with Sublime Text Snippets
  • Jump the Cursor to Where You Want To Go
  • Select Multiple Lines, Words, & Columns
  • Spell check function corrects as you type
  • Cross-platform support(Availble for Microsoft Windows, macOS, Linux) and Supportive Plugins for cross-platform
  • Project-specific preferences
  • The amount of keyboard shortcuts in Sublime are astounding
  • Auto-save, which attempts to prevent users from losing their work

Advantages and Disadvantages

Every application has some advantages and disadvantages. Here we have listed our observations on Sublime.

Pros:

  • It is free to use
  • Perfect for working with large datasets
  • Code Completion is really accurate
  • With colorful coding it is extremely easy to review codes
  • It is highly customizable with a rich ecosystem of third party plugins and the ability to create your own
  • Cross-language compatibility
  • Great keyboard shortcuts
  • Optimized for speed
  • Text highlights are great for debugging
  • Better find-replace feature

Cons:

  • Often prompts to purchase a new version
  • You do need to research to find the right plugin for your use
  • So many Ads
  • Git integration is very weak
  • Less support for other languages
  • Dark theme to Light theme must be just a switch away

This article explains two methods of installing Sublime Text Editor on Ubuntu 20.04.

Choose the installation method that is most appropriate for your environment.

Method 1: Installing Sublime as a Snap Package

The easiest way is to install Sublime Text Editor on Ubuntu 20.04 is by using the snap packaging system.

A snap package is a type of universal Linux package that you can enjoy irrespective of the distro. Its an self-contained software packages that include the binary all dependencies needed to run the application.

All you need is the snap service pre-configured, In the case of Ubuntu 20.04, it comes with snap pre-installed.

If snapd package is not already installed then you can install it by running following command.

$ sudo apt install snapd

Note: Snap packages can be installed from either the command-line or via the Ubuntu Software application.

This is actually the Snap version of the Sublime. It can be used on any Linux distribution that has Snap support.

Open your terminal (Ctrl+Alt+T) and type the following command to install the Sublime package.

$ sudo snap install sublime-text --classic

That’s It. Now you can open the Sublime Text Editor application with the help of Activities search bar.

If you are not comfortable with the command line, open Ubuntu Software, search for “Sublime” and install the application.

Method 2: Installing Sublime from official repositories

Prerequisite: Privileged access to your Linux system as root or via the sudo command.

Open your terminal (Ctrl+Alt+T) and run following commands one by one to install Sublime Text Editor from its official apt repository.

Note: The apt repository contains packages for both x86-64 and arm64.

Step #1

Type the following command to Install the GPG key.

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

Step #2

Ensure apt is set up to work with https sources.

$ sudo apt-get install apt-transport-https

Type the following command to add the official Sublime Text repository, Now it’s up to you which sublime version you want to install.

Add the following repository to install the Stable version:

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

Or add the below repository to install the Development version:

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

Step #3

Now update apt sources and install Sublime Text Editor.

$ sudo apt-get update && sudo apt-get install sublime-text

When the new application version will be released you can update with the help of following command.

$ sudo apt update && sudo apt upgrade

Starting Sublime Text Editor

You can start the Sublime Text editor either from the terminal by typing subl or by clicking on the Sublime icon (Activities -> Sublime).

Sublime Text Editor user interface:

Image Credit: sublimetext.com

How to Uninstall Sublime from Ubuntu 20.04

For some reason, If you want to uninstall Sublime application, refer following commands.

If you have installed Sublime Text Editor via Snap type the following command:

$ sudo snap remove sublime-text

If you have installed the appication using apt then uninstall by running the below command:

$ sudo apt-get remove sublime-text

Conclusion

I hope that now you have a good understanding of How to Install Sublime Text Editor on Ubuntu 20.04 LTS Focal Fossa.

If anyone does have any questions about what we covered in this guide then feel free to ask in the comment section below and I will do my best to answer those.

If you like our content, please consider buying us a coffee.

Buy Me A Coffee

We are thankful for your never ending support.

Leave a Comment