sodcalculator

10 Tech How-To

Install Sublime Text on Ubuntu: A Step-by-Step Guide

Tag 10-13073 · Updated · Standard formula, shown below

The calculator on this page is switched off while it is checked. The formula is below, and the worked example shows how to do the sum by hand.

This guide shows you how to install Sublime Text on Ubuntu, a popular and powerful code editor known for its speed and extensive customization options. You’ll learn the two main methods—using the official repository and using Snap—along with essential post-installation tips and troubleshooting advice.

Why Install via the Official Repository?

Installing Sublime Text from the official repository is the recommended approach for most users. This method ensures you receive updates directly from Sublime HQ, the developer, and integrates cleanly with your system’s package manager. It also avoids the need for a Snap daemon if you prefer a more traditional setup.

Method 1: Using the Official Repository

This method requires adding Sublime HQ’s GPG key and repository to your system’s sources list. Here’s how to do it:

  1. Open a terminal (Ctrl+Alt+T).
  2. Install the required dependencies: sudo apt install apt-transport-https ca-certificates curl software-properties-common
  3. Import the GPG key: curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
  4. Add the repository: sudo add-apt-repository "deb https://download.sublimetext.com/ apt/stable/"
  5. Update your package list: sudo apt update
  6. Install Sublime Text: sudo apt install sublime-text

After installation, you can launch Sublime Text from the application menu or by typing subl in the terminal.

Method 2: Using Snap

Snap is a universal package manager pre-installed on Ubuntu. The Snap version of Sublime Text is maintained by the Snapcraft community and is generally up-to-date. To install, simply run:

sudo snap install sublime-text --classic

The --classic flag is required because Sublime Text needs full access to your system, similar to a traditionally installed application. Once installed, you can launch it from the app grid.

Which Method Should You Choose?

The official repository is the safest and most reliable, as it’s directly controlled by the developers. The Snap version is easier to install (one command) but may lag slightly behind in updates and can have minor performance differences due to the sandboxing. For most users, the official repository is the better choice.

Common Problems and Fixes

  • GPG key error: If you see an error about the GPG key, ensure you’ve imported it correctly. Try re-running the curl command and check your internet connection.
  • Package not found: If apt can’t find the package, run sudo apt update again and verify the repository line is correct.
  • Snap not working: If Snap installation fails, ensure Snap is installed (sudo apt install snapd) and your system is up-to-date.
  • Command not found: After installing, if subl isn’t recognized, you may need to log out and back in, or manually add the binary to your PATH.

Post-Installation Tips

After installing, you might want to install the subl command-line tool (it’s included by default in both methods). You can also install Package Control, which is essential for managing plugins. Additionally, consider setting Sublime Text as your default editor for certain file types via the system settings.

Frequently Asked Questions

Is Sublime Text free to use?

Yes, Sublime Text has an unlimited free evaluation period, but it will occasionally prompt you to purchase a license. You can continue using it without paying, but a license is recommended for continued development.

How do I update Sublime Text?

If installed via the official repo, updates come through sudo apt update && sudo apt upgrade. For Snap, updates are automatic in the background, or you can force with sudo snap refresh sublime-text.

Can I install Sublime Text on other Linux distributions?

Yes, the official repository method works on Debian-based systems (like Debian, Linux Mint). For other distros, you can download the tarball from the official website or use community packages.

Why is Sublime Text not opening?

Check if the process is running (ps aux | grep sublime). If it’s stuck, try killing it and restarting. Also, ensure your system meets the minimum requirements (any modern Ubuntu should).

How do I uninstall Sublime Text?

For the repo version, run sudo apt remove sublime-text. For Snap, use sudo snap remove sublime-text. This will remove the application but may leave config files in ~/.config/sublime-text.

Related

Formula used
sel method | Installation Method | Official Repository=1, Snap=2 | 1
in repo | Repository (Official) | - | 1 | 1
in snap | Snap (Latest) | - | 2 | 2
out cmd | Command to Run | - | IF(sel_method=1, "sudo apt install sublime-text", "sudo snap install sublime-text --classic") | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More in this bed

The whole Tech How-To bed →