1. Home
  2. Linux

How to install Sublime Text 3 on Linux

Sublime Text is a proprietary code editor for Linux and other platforms. It’s an excellent code editor. In this guide, we’ll go over how to install Sublime Text 3 on Ubuntu, Debian, Arch Linux, Fedora, and OpenSUSE.

Note: Sublime Text costs money, but users can install it free of charge to evaluate it. To get a license, click here.

Ubuntu/Debian instructions

The Sublime Text editor supports Ubuntu Linux and Debian Linux through a third-party software repository. So, if you’re a developer on one of these operating systems and looking to get the app up and running, here’s what to do.

To start, launch a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift on the keyboard. From there, use the update commands to ensure your OS has the latest patches.

Note: replace apt commands with apt-get if your Debian install doesn’t have the Apt package manager.

sudo apt update
sudo apt upgrade -y

With everything up to date, use the installation tool to install the apt-transport-https package, so that you can install packages over HTTPS protocol.

sudo apt install apt-transport-https

Next, using the echo and tee commands, add the Sublime Text third-party software source to your Apt/Apt-get program sources.

Sublime Text stable release

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

Sublime Text development release

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

With the new sources added, re-run the update command, so that the system can download and set Sublime Text’s third-party software source’s packages into Apt’s library.

sudo apt update

Finally, install the Sublime Text code editor on your Ubuntu or Debian Linux PC with the following command.

sudo apt install sublime-text

Arch Linux instructions

Arch Linux users can install the latest Sublime Text release thanks to a dedicated, third-party Pacman software repository. To start off the setup process, use the curl app to grab the newest GPG key file.

curl -O https://download.sublimetext.com/sublimehq-pub.gpg

Next, once the Sublime Text repo key is done downloading, use pacman-key to activate it on the system.

sudo pacman-key --add sublimehq-pub.gpg
sudo pacman-key --lsign-key 8A8F901A

After the Sublime Text GPG key is active, use the rm command to delete the key file from your system. Then, run echo and tee to add the third-party software repository to the “Pacman.conf” file.

rm sublimehq-pub.gpg
echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/stable/x86_64" | sudo tee -a /etc/pacman.conf

Or, for the development release:

echo -e "\n[sublime-text]\nServer = https://download.sublimetext.com/arch/dev/x86_64" | sudo tee -a /etc/pacman.conf

Using Pacman, re-sync your Arch system’s package repositories. Be sure to add in ‘uu‘ to install any pending software upgrades as well.

sudo pacman -Syyuu

Following the update and re-sync, you’ll be able to install the latest release of Sublime Text on Arch Linux.

sudo pacman -S sublime-text

Fedora instructions

Need to use the Sublime Text code editor on Fedora Linux? If so, you’ll need to activate the dedicated Fedora Sublime Text software source. To start, launch a terminal window by pressing Ctrl + Alt + T or Ctrl + Shift + T. Then, use the rpm command to import Sublime Text’s public GPG key.

sudo rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg

Assuming adding the Sublime Text GPG key is successful, use the dnf command to add the third-party Sublime Text software repository.

Sublime Text stable release

sudo dnf config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo

Sublime Text development release

sudo dnf config-manager --add-repo https://download.sublimetext.com/rpm/dev/x86_64/sublime-text.repo

With the repo added to Fedora Linux, use the dnf install command to get the latest version of Sublime Text.

sudo dnf install sublime-text

OpenSUSE instructions

Sublime Text supports all current releases of OpenSUSE Linux. To get it working, open up a terminal window and add the public GPG key.

sudo rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg

Next, add the Sublime Text software repository using the zypper addrepo command.

Sublime Text stable release

sudo zypper addrepo -g -f https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo

Sublime Text development release

sudo zypper addrepo -g -f https://download.sublimetext.com/rpm/dev/x86_64/sublime-text.repo

Lastly, install Sublime Text on OpenSUSE with the zypper install command.

sudo zypper install sublime-text

Snap instructions

Sublime Text is available on the Snap store. If you’d like to get your hands on it through the store, head over to our guide on how to enable Snapd on your Linux OS.

Once you’ve got the Snapd runtime enabled, use the snap install command below to get the latest version of Sublime Text on your system.

sudo snap install sublime-text

Flapak instructions

Flatpak has a lot of apps available, including the most up-to-date version of the Sublime Text code editor. To get it working on your system, head over to our guide on how to enable the Flatpak runtime on your Linux OS.

After enabling the Flatpak runtime on your system, you’ll be able to quickly set up the latest release of Sublime Text on Linux with the commands below.

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo 

sudo flatpak install flathub com.sublimetext.three  -y

Leave a comment