Trending

How to Install Sublime Text on Ubuntu Using APT or Tarball

• • 16 min read
How to Install Sublime Text on Ubuntu Using APT or Tarball

To install Sublime Text on Ubuntu, the preferred method is the official Sublime Text APT repository, which provides authenticated packages and automatic updates. A manual tarball installation is also available for users who want direct control over the installation directory. Sublime Text 4 is the current release, while Sublime Text 3 is now a legacy version.

Sublime Text remains a popular lightweight editor for code, markup, configuration files, and general text editing. On Ubuntu, it can be installed through the official package repository or manually from an extracted Linux tarball, depending on whether automatic package management or installation portability matters more.

Older Ubuntu tutorials often use Sublime Text 3 tarballs, deprecated APT key commands, hard-coded build numbers, and manually created desktop entries. Those instructions can still explain the underlying installation process, but new Ubuntu installations should use Sublime HQ’s current repository format or current Linux downloads rather than obsolete package-management commands.

The official Sublime Text download page currently provides Linux packages and direct downloads for 64-bit x86 and ARM64 systems. Sublime Text can be evaluated before purchase, while continued use requires a valid license under Sublime HQ’s licensing terms.

Sublime Text APT Installation vs. Tarball Installation

Ubuntu users have two practical ways to install Sublime Text outside community packaging systems. The official APT repository integrates the editor with Ubuntu’s package manager, while the tarball method extracts a self-contained application directory and requires some manual integration.

The official APT repository is the better choice for most Ubuntu systems. Updates arrive through normal APT operations, the desktop launcher is installed automatically, package files are tracked by the package manager, and the subl command is placed in the expected system path.

A tarball installation becomes useful when package-manager integration is undesirable, when a specific directory under /opt is preferred, or when an administrator wants tighter control over when the editor is replaced. Tarball installations are also helpful for understanding how Linux desktop launchers, executable paths, and symbolic links work.

Check Your Ubuntu Architecture Before Installing Sublime Text

Before downloading a Linux build manually, confirm the system architecture. Current Sublime Text Linux downloads are available for x86-64 and ARM64, while current official documentation states that 32-bit Linux builds have been discontinued.

Run:

uname -m

A typical Intel or AMD 64-bit computer returns x86_64. An ARM64 Ubuntu system generally returns aarch64. Selecting the correct build is essential because an executable compiled for the wrong processor architecture will not start normally.

Method 1: Install Sublime Text on Ubuntu With the Official APT Repository

Sublime HQ provides an official repository specifically for Debian- and Ubuntu-based systems. The repository currently distributes packages for both x86-64 and ARM64 and supports stable and development channels.

The stable channel is appropriate for normal development environments. Development builds change more frequently and, according to Sublime Text’s official repository documentation, dev-channel builds are available to licensed users.

  1. Step 1: Update Ubuntu Package Information

    Start by refreshing APT’s package metadata:

    sudo apt update

    This command synchronizes package information from repositories already configured on the system. It does not by itself install Sublime Text.

  2. Step 2: Install Tools Needed to Download the Repository Key

    Most Ubuntu desktop installations already include wget. If necessary, install it with:

    sudo apt install wget

    The repository signing key allows APT to verify that downloaded Sublime Text packages originate from the repository associated with Sublime HQ rather than an untrusted replacement source.

  3. Step 3: Install the Sublime HQ Repository Signing Key

    Use the current command published in the official Sublime Text Linux repository documentation:

    wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo tee /etc/apt/keyrings/sublimehq-pub.asc > /dev/null

    This avoids the obsolete apt-key workflow found in many older tutorials. The key is stored in Ubuntu’s dedicated APT keyring directory and referenced explicitly by the repository configuration.

  1. Step 4: Add the Stable Sublime Text APT Repository

    Create the repository source definition using the format currently documented by Sublime HQ:

    echo -e 'Types: deb\nURIs: https://download.sublimetext.com/\nSuites: apt/stable/\nSigned-By: /etc/apt/keyrings/sublimehq-pub.asc' | sudo tee /etc/apt/sources.list.d/sublime-text.sources

    This configuration tells APT where the Sublime Text packages are located and which signing key should be used to authenticate the repository.

  2. Step 5: Refresh APT After Adding the Repository

    Run the package update command again:

    sudo apt update

    APT should now contact the Sublime Text repository in addition to the Ubuntu repositories already configured on the machine. Repository-related errors at this stage should be resolved before continuing.

  3. Step 6: Install Sublime Text

    Install the editor using:

    sudo apt install sublime-text

    APT downloads the required package, installs it into standard system locations, registers the desktop application, and handles package metadata automatically.

  4. Step 7: Verify the Sublime Text Installation

    Confirm that the command-line launcher is available:

    command -v subl

    An APT installation normally returns /usr/bin/subl. The official Sublime Text command-line documentation confirms that Linux package installations automatically provide the subl command through the system path.

How to Launch Sublime Text on Ubuntu

After an APT installation, open Ubuntu’s application launcher and search for Sublime Text. The application should appear alongside other installed desktop programs because the package installs the required desktop integration.

It can also be launched directly from Terminal:

subl

To open the current directory as a Sublime Text project or folder:

subl .

To open a specific file:

subl filename.txt

The subl command is especially useful for developers working primarily from Terminal. It allows files and directories to be sent directly into the graphical editor without navigating through a file manager.

Method 2: Install Sublime Text on Ubuntu From a Tarball

A tarball installation does not use APT to manage the application itself. Instead, the archive is downloaded, extracted, moved into a permanent directory, and connected to the desktop and shell through launchers or symbolic links.

The original Sublime Text 3 workflow used files with names similar to sublime_text_3_build_3176_x64.tar.bz2 or later Sublime Text 3 builds. Current Sublime Text Linux direct downloads use the current release series and may use .tar.xz instead. Use the current filename supplied by the official download page rather than copying an old hard-coded build URL.

The historical Sublime Text 3 download referenced by older versions of this tutorial was:

https://localhost/smartupworld/download/sublime/sublime_text_3_build_3176_x64.tar.bz2

That legacy local URL should not be treated as the source for a new installation. Obtain current binaries from the official Sublime Text Linux download page so the package architecture, version, and release file are current.

  1. Step 1: Download the Correct Sublime Text Linux Tarball

    Download the appropriate 64-bit x86 or ARM64 tarball from Sublime HQ. Saving the archive in the normal Downloads directory makes the remaining commands easier to follow.

    Move into that directory with:

    cd ~/Downloads

    Confirm the actual downloaded filename before extracting it:

    ls sublime*

  2. Step 2: Extract the Sublime Text Tarball

    For a current .tar.xz archive, extraction normally follows this pattern:

    tar -xf sublime_text_build_*_x64.tar.xz

    For an older Sublime Text 3 .tar.bz2 archive, the corresponding command is:

    tar -xjf sublime_text_3_build_*_x64.tar.bz2

    The extracted directory contains the Sublime Text executable, application resources, icons, packages, and desktop-integration files.

  1. Step 3: Move Sublime Text Into the /opt Directory

    The /opt hierarchy is commonly used for manually installed third-party software. After confirming the name of the extracted directory, move it there.

    For a Sublime Text 3 archive whose directory is named sublime_text_3, an example is:

    sudo mv sublime_text_3 /opt/sublime_text_3

    For a current release, adjust both source and destination names to match the extracted directory. Avoid blindly running a command copied from an older guide if the archive uses a different folder structure.

  2. Step 4: Create the subl Terminal Command

    A manual installation can expose the editor through a symbolic link. For the historical Sublime Text 3 directory layout, the command is:

    sudo ln -s /opt/sublime_text_3/sublime_text /usr/local/bin/subl

    /usr/local/bin is preferable for manually managed local executables because it keeps administrator-created links separate from files managed directly by distribution packages.

    If a link already exists, inspect it before replacing anything:

    ls -l /usr/local/bin/subl

  3. Step 5: Add Sublime Text to the Ubuntu Application Launcher

    Sublime Text tarballs include a desktop entry. A convenient integration method is to link that desktop file into the system application directory.

    For an older Sublime Text 3 layout:

    sudo ln -s /opt/sublime_text_3/sublime_text.desktop /usr/share/applications/sublime_text.desktop

    The application’s own desktop file is preferable to manually constructing one unless customization is specifically required. It reduces the risk of incorrect executable, icon, MIME type, or action definitions.

  4. Step 6: Refresh the Desktop Application Database

    When desktop entries are added manually, refresh the application database where the utility is available:

    sudo update-desktop-database

    Log out and back in if the desktop environment does not immediately display the new launcher. GNOME may cache application information during a running session.

How to Create a Custom Sublime Text Desktop Launcher

If the tarball’s included desktop entry cannot be used, a custom launcher can be created. The executable and icon paths must match the actual installation directory.

A minimal example for a manual Sublime Text 3 installation is:

[Desktop Entry] Version=1.0 Type=Application Name=Sublime Text GenericName=Text Editor Comment=Sophisticated text editor for code, markup and prose Exec=/opt/sublime_text_3/sublime_text %F Terminal=false Icon=/opt/sublime_text_3/Icon/48x48/sublime-text.png Categories=TextEditor;Development; StartupNotify=true MimeType=text/plain;

The path after Exec= must point to the real executable. Likewise, the Icon= value must reference an existing icon file. A launcher copied from a different Sublime Text build can fail simply because its installation directory or icon hierarchy no longer matches.

How to Add Sublime Text to the Ubuntu Open With Menu

Desktop entries registered under /usr/share/applications are normally available system-wide. A user-specific desktop launcher can instead be stored under ~/.local/share/applications.

For a manually installed Sublime Text 3 desktop file, an older approach uses:

mkdir -p ~/.local/share/applications

cp /usr/share/applications/sublime_text.desktop ~/.local/share/applications/

Then refresh the user’s application database if required:

update-desktop-database ~/.local/share/applications

This can help expose Sublime Text as an application choice for compatible text files. File associations remain desktop-dependent, so the exact Open With behavior can vary between Ubuntu environments and file managers.

How to Update Sublime Text on Ubuntu

An APT installation is simple to maintain because Sublime Text participates in normal package upgrades. Once the official repository has been configured, refresh package information and install available upgrades through Ubuntu’s usual package-management process.

To refresh repository metadata:

sudo apt update

To upgrade the Sublime Text package specifically:

sudo apt install --only-upgrade sublime-text

A tarball installation requires more manual work. Download the replacement archive, exit running Sublime Text processes, preserve user configuration, replace the application directory under /opt, and confirm that existing launcher paths and symbolic links still point to valid files.

Where Sublime Text Stores User Settings on Linux

Application binaries and user data should be treated separately. Current Sublime Text documentation identifies ~/.config/sublime-text as the normal Linux user data location for the current release series.

Older Sublime Text 3 installations commonly used:

~/.config/sublime-text-3

This distinction matters during migration. Replacing the program directory under /opt does not automatically mean user preferences should also be deleted. Settings, packages, snippets, sessions, and other user-level resources normally live outside the application installation directory.

The original tutorial also referenced the following legacy local settings location:

https://localhost/smartupworld/download/sublime/settings

For a clean modern installation, configure preferences inside Sublime Text instead of importing unknown or outdated settings bundles. Old settings can contain package references, API changes, or preferences that no longer apply to the current editor.

How to Install Package Control in Sublime Text

Package Control is the commonly used package manager for Sublime Text. It provides access to packages that add language tooling, linters, themes, build integrations, completions, and other editor functionality.

Open the Command Palette using Ctrl+Shift+P, search for Install Package Control, and run the command when available. After installation, open the Command Palette again and choose Package Control: Install Package to browse supported packages.

The official Package Control package listing documents the current installation procedure and package-management workflow. Package compatibility can vary by Sublime Text build, so packages originally developed for Sublime Text 3 should be checked before being carried into a current installation.

How to Remove Sublime Text From Ubuntu

If Sublime Text was installed from the official APT repository, remove the package with:

sudo apt remove sublime-text

To remove its package configuration as well:

sudo apt purge sublime-text

The repository definition can be removed separately if it is no longer needed:

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

Then refresh APT:

sudo apt update

For a tarball installation, removal means deleting the application directory and any symbolic links or desktop launchers that were manually created. Verify each path before using rm, especially when other Sublime Text installations are present.

Common Sublime Text Installation Problems on Ubuntu

The subl Command Is Not Found

Run command -v subl. An official package installation should normally provide the command automatically. With a tarball installation, create a valid symbolic link from the Sublime Text executable to a directory included in PATH, such as /usr/local/bin.

Sublime Text Does Not Appear in the Applications Menu

Confirm that a valid .desktop file exists under /usr/share/applications or ~/.local/share/applications. Check its Exec and Icon paths, run update-desktop-database where appropriate, and restart the desktop session if GNOME continues showing cached application data.

APT Reports a Sublime Text Repository Error

Repository problems commonly result from outdated instructions, malformed source files, or obsolete key configuration. Remove or correct the broken Sublime Text source and follow the current commands published in the official Sublime Text Linux repository documentation.

A Downloaded Tarball Will Not Run

Check the CPU architecture with uname -m and confirm that the archive matches the machine. Sublime Text’s current Linux documentation also lists runtime library requirements such as GLIBC, GTK, GLib, FreeType, Cairo, Pango, and OpenGL-related libraries.

Pro Tips for Installing and Managing Sublime Text

Prefer the Official Repository for Long-Term Ubuntu Use

The APT repository eliminates most manual maintenance. Package files, launcher integration, repository authentication, updates, and removal are handled through the same package-management tools already used by Ubuntu.

Avoid Hard-Coded Legacy Build URLs

Old tutorials often point directly to a specific Sublime Text 3 build. Those URLs become outdated as product versions and supported architectures change. Use the official download page to determine the current build rather than assuming an old archive is still the appropriate installation.

Do Not Use Old apt-key Installation Commands

Many historical Ubuntu instructions pipe repository keys into apt-key add. Current Sublime Text documentation instead stores the signing key in /etc/apt/keyrings and explicitly connects that key to the repository definition.

Keep Manual Software Under a Predictable Directory

When installing from a tarball, use a consistent path such as /opt/sublime_text or another clearly managed application directory. Predictable paths make desktop launchers, shell commands, upgrades, backups, and removal easier to maintain.

Use /usr/local/bin for Manually Created Commands

When creating the subl launcher yourself, /usr/local/bin keeps locally administered commands separate from files typically controlled by Ubuntu packages. This reduces confusion when troubleshooting package ownership.

Back Up Settings Before Major Migrations

Copy the relevant Sublime Text directory under ~/.config before migrating from Sublime Text 3, replacing a manual installation, or making extensive package changes. A backup protects custom snippets, preferences, key bindings, and project-specific editor configuration.

Frequently Asked Questions About Sublime Text on Ubuntu

How do you install Sublime Text on Ubuntu using Terminal?

Add Sublime HQ’s official repository signing key and stable APT source, run sudo apt update, then install the editor with sudo apt install sublime-text. The official repository is the preferred Ubuntu installation method because it integrates updates, desktop launchers, and the subl terminal command with the operating system’s package manager.

Can Sublime Text be installed from a tarball on Ubuntu?

Yes. Download the correct Linux tarball from Sublime Text’s official site, extract it, move the application directory to a location such as /opt, and create launcher links as required. Tarball installation works well for manual deployment, but updates and desktop integration must generally be managed manually.

Is Sublime Text 3 still the latest version?

No. Sublime Text 3 is a legacy release, while Sublime Text 4 is the current product generation. Older Sublime Text 3 instructions remain useful when maintaining existing installations, but new Ubuntu systems should normally use current Sublime Text packages and installation documentation rather than downloading historical Sublime Text 3 builds.

Is Sublime Text free on Ubuntu?

Sublime Text can be downloaded and evaluated without immediately purchasing a license, but Sublime HQ states that a license must be purchased for continued use. Ubuntu installation method does not change the licensing terms. Avoid license keys published on websites, forums, or old tutorials and obtain legitimate licensing directly from Sublime HQ.

Where is Sublime Text installed on Ubuntu?

An official package installation places files in Linux system locations managed by the package. A manual tarball installation can be placed under /opt, such as /opt/sublime_text. User preferences are stored separately, with current versions typically using ~/.config/sublime-text and older Sublime Text 3 installations commonly using ~/.config/sublime-text-3.

How do you open Sublime Text from Ubuntu Terminal?

Run subl after installing Sublime Text and ensuring its command-line launcher is available. Use subl . to open the current directory or subl filename.txt to open a specific file. Official Linux package installations normally install the subl launcher automatically into the system command path.

Should Sublime Text be installed with APT or a tarball?

APT is the better option for most Ubuntu users because updates, package verification, desktop integration, and removal remain centrally managed. Choose a tarball when manual installation control is specifically required, such as maintaining software under a custom directory or managing updates independently from Ubuntu’s package system.

Activate the program with the following code –

—– BEGIN LICENSE —–
sgbteam
Single User License
EA7E-1153259
8891CBB9 F1513E4F 1A3405C1 A865D53F
115F202E 7B91AB2D 0D2A40ED 352B269B
76E84F0B CD69BFC7 59F2DFEF E267328F
215652A3 E88F9D8F 4C38E3BA 5B2DAAE4
969624E7 DC9CD4D5 717FB40C 1B9738CF
20B3C4F1 E917B5B3 87C38D9C ACCE7DD8
5F7EF854 86B9743C FADC04AA FB0DA5C0
F913BE58 42FEA319 F954EFDD AE881E0B
—— END LICENSE ——

# Get the files from the following link and post them on Sublime –
https://localhost/smartupworld/download/sublime/settings

Conclusion

Installing Sublime Text on Ubuntu is most reliable through Sublime HQ’s official APT repository. The repository method provides authenticated packages, straightforward upgrades, automatic desktop integration, and a working subl command without requiring manually maintained launchers or hard-coded application paths.

Tarball installation remains valuable when manual deployment is required. The essential workflow is to download the correct architecture, extract the archive, place the application in a stable directory such as /opt, create an appropriate command-line link, and register the supplied desktop entry. Avoid copying obsolete build numbers, deprecated APT commands, or unauthorized license keys from historical tutorials.

Sublime Text 3 installations can continue to be maintained where legacy workflows require them, but new installations should use current Sublime Text packages and current official documentation. Keeping application files, user configuration, repository settings, and desktop launchers clearly separated makes upgrades and troubleshooting considerably easier.

 

 

Al Mahbub Khan
Written by Al Mahbub Khan Full-Stack Developer & Adobe Certified Magento Developer

Leave a Reply