This simple tutorial shows how to install the latest Sublime Text 4, the popular source code editor, in Debian, Ubuntu, and / or Linux Mint in different ways.
The latest Sublime Text 4 is available to install in three different ways for Debian and Ubuntu based systems. They are Snap, Flatpak, and official apt repository packages.
Install Sublime Text 4 via Snap package:
The easiest way installing the editor is using the Snap, a containerized package format developed by Canonical.
For Ubuntu 18.04, Ubuntu 20.04 and higher, the community maintained Sublime Text Snap package is available to install directly via Software.
As an alternative, install the snap via command in terminal:
snap install sublime-text --classic
Install Sublime Text 4 via its official apt repository:
The editor offers official Linux repositories for Debian, Ubuntu, Arch, CentOS, Fedora, and openSUSE.
For Ubuntu, Debian, Linux Mint, and derivatives, open terminal and run following commands one by one to add the repository and install Sublime Text:
- Download and install the GPG key via command:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
- Ensure apt is set up to work with https sources:
sudo apt-get install apt-transport-https
- Then add the apt repository by running command:
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
- Finally check updates and install the code editor:
sudo apt update && sudo apt install sublime-text
To uninstall the package, run command:
sudo apt remove sublime-text
The editor is also available to install via Flatpak, universal Linux package runs in sandbox.
The community maintained Flatpak package is not updated at the moment of writing. Use apt or snap instead.
You can either download it from the flathub.org repository:
or run following commands one by one in terminal:
sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub com.sublimetext.three
For choices, update the flatpak package via command:
flatpak update com.sublimetext.three
And you can remove it via command:
flatpak uninstall com.sublimetext.three
The Snap package is the easiest way to get the text editor, it is however not supported out-of-the-box in Linux Mint 20. While Flatpak runs in sandbox and takes a little more on disk usage, the official apt repository can be the best way installing Sublime Text 4 in Ubuntu, Debian, and Linux Mint.