Archives For Sublime Text

For those want to install the Sublime Text code editor, here’s the step by step how to guide for Ubuntu 22.04 in 3 different ways.

Option 1: Snap package

A group of contributers maintain the text editor in Snap package format. Ubuntu 20.04 + users can simply search for and install it from Ubuntu Software (aka Snap Store):

Install Sublime Text from Ubuntu Software

The snap package runs in sandbox and always up-to-date since it receives updates automatically. The only downside could be that some do NOT like sandboxing apps.

For those prefer Linux commands, the package also can be installed by running the command below in terminal:

sudo snap install sublime-text --classic

Option 2: Official Apt repository

This is the official .deb package works in Ubuntu, Linux Mint, Debian, and even Raspberry Pi OS (arm64).

1. Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run the command below to make sure ‘https’ source is supported:

sudo apt-get install apt-transport-https

2. Add the repository key

The sublime text website still use the ‘apt-key‘ command in its document, which is deprecated.

For security reason, Debian has updated the policy. And, it’s recommend to use the command below instead to install the key:

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

It will download the key from its website, convert it to un-readable encrypted key, and put into “/usr/share/keyring” directory.

3. Add the official repository

Next, run the command below to create a source file and edit it via Gedit text editor:

sudo gedit /etc/apt/sources.list.d/sublime-text.list

When the file opens, add the following line (it’s a single line) and save it.

deb [signed-by=/usr/share/keyrings/sublimehq-pub.gpg] https://download.sublimetext.com/ apt/stable/

This step can be done alternatively by running the single command below:

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

4. Finally, update system package cache and install the code editor by running the following 2 commands one by one:

sudo apt update
sudo apt install sublime-text

Option 3: Flatpak package

Sublime Text 4 is NOT available as Flatpak so far. But for the old version 3, you may install it by running the commands below one by one in terminal.

NOTE: Like Snap, the Sublime Text as flatpak is also un-official package maintained by contributors, runs in sandbox and updates automatically.

Firstly, press Ctrl+Alt+T to open terminal and run command to install Flatpak daemon:

sudo apt install flatpak

Then, install Sublime Text 3 via Flatpak by running command:

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

Uninstall Sublime Text:

For the Snap package, remove it either using Ubuntu Software or by running command in terminal:

sudo snap remove --purge sublime-text

For the Flatpak package, use the command to uninstall the package:

flatpak uninstall --delete-data com.sublimetext.three

and cleanup useless run-times via flatpak uninstall --unused.

For the official .deb package, remove it by running command:

sudo apt remove --autoremove sublime-text

The apt repository will not display in “Software & Updates” utility, so get rid of it by running command to remove the source file:

sudo rm /etc/apt/sources.list.d/sublime-text.list

And remove the key file by running command:

sudo rm /usr/share/keyrings/sublimehq-pub.gpg

Summary:

Here I introduced 3 ways to install Sublime Text in Ubuntu. The Snap is the easiest, which is available in Ubuntu Software, but the official apt repository is recommended! For those still looking for the old Sublime Text 3, the Flatpak package is available for choice.

Sublime Text 4 was officially released a day ago. Here’s how to install it in Ubuntu 21.04, Ubuntu 20.04 via apt repository.

Sublime Text 4 (Build 4107) feature multi-select tabs. Press and hold Ctrl (or Shift), then you can select tabs to view them side by side.

And now it supports for auto-switching between dark and light themes to follow system appearance.

Other release highlights include:

  • Context-aware auto complete
  • ARM64 support for Linux and macOS (Apple Silicon)
  • Python 3.8 support for plugins
  • Built-in TypeScript, JSX and TSX support
  • GPU rendering, disabled by default in Windows and Linux.
  • Wayland support for Linux.

There are also tons of other changes, see the announcement for details.

How to Install Sublime Text 4 in Ubuntu:

Open terminal from system application menu, then run following commands one by one to install Sublime Text 4 from its official apt repository.

1.) Download and install the GPG key by running command:

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

Type user password when it prompts and hit Enter to continue.

Make sure https is supported by running command:

sudo apt install apt-transport-https

2.) Add the official Sublime Text repository via command:

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

3.) Finally refresh system package cache and install the text editor via commands:

sudo apt update

sudo apt install sublime-text

And you’ll receive future updates along with system updates through Software Updater (Update Manager).

How to Uninstall Sublime Text:

To remove the apt repository, launch Software & Updates and go to Other Software tab, there remove the repository line.

And to remove the Sublime Text editor, simply run command:

sudo apt remove --autoremove sublime-text

Sublime Text 3.2 was released yesterday with first-class Git integration, GTK3 port, and many other new features.

Sublime Text 3.2 release highlights:

  • First-class Git integration
  • Incremental diff functionality tracks changes to files being edited.
  • Moved to GTK3, and various high DPI fixes for Linux.
  • New theme functionality and block caret support.
  • Support for Unicode 11.0
  • Many syntax highlighting improvements to Clojure, D, Go, Lua.

How to Install Sublime Text 3.2 in Ubuntu:

The easiest way is to install the community maintained Snap package (run in sandbox).

For Ubuntu 18.04 and higher, simply open Ubuntu Software search for and install sublime-text

For Ubuntu 16.04, open terminal (Ctrl+Alt+T) and run command to install the snap:

sudo apt install snapd && sudo snap install sublime-text

Install Sublime Text 3.2 via its official apt repository:

For those who don’t prefer Snap package, do following steps to install Sublime Text from its official apt repository:

1. Open terminal either via Ctrl+Alt+T keyboard shortcut or from app launcher. When it opens, run command to add the keyring:

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

Type user password (no asterisk feedback) when it prompts and hit Enter.

2. Then run command to add the apt repository:

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

3. Finally install sublime-text package either via Synaptic package manager or by running command:

sudo apt update && sudo apt install sublime-text

Uninstall:

To remove the editor, run command:

sudo apt remove --autoremove sublime-text

To remove the apt repository, go to Software & Updates -> Other Software.

The community has made Sublime Text 3 into the SNAP package. So far, it’s available for testing in candidate channel.

A snap is an universal Linux application comes with all its dependencies bundled. It runs in sandbox and is isolated from other system software.

If you just want to install latest stable Sublime Text 3 in Ubuntu. There’s an official apt repository and here’s how-to tips.

Install Sublime Text 3 via Snap:

Once the snap is published into stable channel, you can easily install or remove it in Ubuntu Software

Open terminal either via Ctrl+Alt+T or by searching for ‘terminal’ from application launcher. When it opens, run command:

snap install sublime-text-3 --classic

The command works in Ubuntu 16.04 and higher. And the --candidate flag is not required anymore since the snap is now in stable.

The snap package co-exists with traditional packages, you’ll have two launcher icons:

To make sure you’re running the snap app, you can launch it from the terminal command:

/snap/bin/sublime-text-3

Uninstall:

To remove the snap app for Sublime Text 3, run command:

snap remove sublime-text-3

How to Install Sublime Text 2 / 3 in Ubuntu 14.10

Last updated: October 13, 2014

install sublime text 2 3 ubuntu 14.10

Quick tutorial to install Sublime Text 2 stable, so far its 2.0.2, or Sublime Text 3 Beta in Ubuntu 14.10 Utopic Unicorn.

Sublime Text is a close-source text and code source editor with an Python API. It may be downloaded and evaluated for free, however a license must be purchased for continued use.

For the features and supported languages, see the wikipedia page.

Sublime Text 2 in Ubuntu 14.10

Sublime Text 2 in Ubuntu 14.10

Install Sublime Text in Ubuntu:

Thanks to WebUpd8 Team, an installer has been made into PPA that automatically downloads the stable or beta release of Sublime Text from its official site and installs it on your system.

Press Ctrl+Alt+T on keyboard to open the terminal. When it opens, run below commands one by one:

To install Sublime Text stable:

sudo add-apt-repository -y ppa:webupd8team/sublime-text-2

sudo apt-get update

sudo apt-get install sublime-text

When running the first command, you will be asked to type in user password and there will be no visual feed back.

Install Sublime Text in Ubuntu from PPA

To install Sublime Text 3 Beta:

sudo add-apt-repository -y ppa:webupd8team/sublime-text-3

sudo apt-get update

sudo apt-get install sublime-text-installer

Once installed, launch the editor from the Unity Dash or menu and enjoy!