How to Install Sublime Text on the Raspberry Pi

This tutorial will show you how to install the Sublime Text editor on the Raspberry Pi.

Raspberry Pi Sublime Text

Sublime Text is a shareware text and code editor known for its native support for many programming languages, extensibility, robust auto-completion, and more.

While Sublime requires a license for continued use, it has an evaluation mode you can use to see whether this code editor suits your needs. The only drawback of the evaluation mode is that it will continually prompt you to purchase a license.

If you don’t really like the Sublime Text experience on your Raspberry Pi, then you can always check out the free and hugely popular, Visual Studio Code.

Thanks to the Sublime team putting out ARM64 builds, installing this code editor is a relatively straightforward process. Once you add the Sublime repository, installing this editor is just a single command.

The downside of only having an ARM64 build is that you must be running a 64-bit operating system. This means you can only use this on a Raspberry Pi 3 and newer.

Equipment

Below you can find a list of the equipment we used when installing the Sublime text editor on our Raspberry Pi.

Recommended

Optional

This tutorial was last tested on a Raspberry Pi 5 running the latest version of Raspberry Pi OS Bookworm.

Quick and Easy Steps to Installing Sublime Text on a Raspberry Pi

In the following steps, we will walk you through the easiest way to install the latest version of Sublime Text on your Raspberry Pi.

Since this package isn’t available through the normal Raspberry Pi OS repository, we must add Sublime’s own. Luckily, this process is relatively easy to follow.

Preparing your Raspberry Pi to Install Sublime

1. Before installing the Sublime text editor, we should ensure that our Raspberry Pi is up-to-date.

You can update the packages on Raspberry Pi OS by running the following two commands within the terminal.

sudo apt update
sudo apt upgrade -y

2. After updating your Raspberry Pi, we must install the wget package.

Typically, this is pre-installed, but it only takes a little to ensure that this package is available.

sudo apt install wget

Adding the Sublime Text Package Repository

3. Our next step is to use the wget package to download and save the Sublime text editor GPG key to our Raspberry Pi. This GPG key helps ensure that installing a valid package from Sublime.

You can save this GPG key on your system by running the command below.

wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/sublimehq-archive.gpg > /dev/null

4. With the GPG key now saved on your system, you can add the Sublime repository to your package sources using the following command.

Next time you update your Raspberry Pi’s package list cache, it will search this repository for packages it can install.

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

5. As we modified the available package repositories, you must update your Pi’s package list cache by using the following command.

sudo apt update

Installing the Sublime Text Editor on your Raspberry Pi

6. At this point, we can finally install the Sublime text editor to your Raspberry Pi by running the following command.

This software isn’t super large, so it should only take a few minutes to install.

sudo apt install sublime-text

How to Open the Sublime Text Editor

7. Now that you have Sublime installed on your Raspberry Pi, let’s explore a couple of different ways to open it.

Opening Sublime from the Terminal

a. Due to how Sublime Text is installed on your system, you must type in the full path whenever you want to launch it using the terminal.

If you want to avoid having to type out the full path to Sublime you must add this path to your environment variables.

/opt/sublime_text/sublime_text

b. You can also get Sublime to open a file by specifying the path directly after the call to the Sublime text editor.

/opt/sublime_text/sublime_text /path/to/file

Opening Sublime from the Desktop Interface

a. On the desktop, you will want to bring up the start menu by clicking the Raspberry icon in the top-left corner.

Open start menu

b. With the start menu open, hover over the “Programming” option (1.).

You should see a few more options appear; click the one labeled “Sublime Text” (2.).

Open Sublime Text

c. You now have the Sublime Text editor open on your Raspberry Pi.

Sublime Text running on the Raspberry Pi

Conclusion

Hopefully, at this stage, you will have a good understanding of how to install the Sublime text editor on the Raspberry Pi.

Sublime Text is a powerful text editor that you can easily use on your Pi or any other system. While there are now several great alternatives, there are still some areas where Sublime excels.

Please post a comment below if you have had any issues installing the Sublime text editor on your Pi.

If you liked this tutorial, we recommend browsing through the many other Raspberry Pi projects we offer.

Leave a Reply

Your email address will not be published. Required fields are marked *

6 Comments

  1. Avatar for poing leve
    poing leve on

    The arch command gives me the following answer: aarch64.
    I think it should be good…

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Poing,

      Hmm, that is definitely strange then. Could you please try using the following command and let me know what it returns.

      dpkg-architecture --query DEB_HOST_ARCH

      Kind regards,
      Emmet

    2. Avatar for poing leve
      poing leve on

      Here is the answer to the command :
      dpkg-architecture –query DEB_HOST_ARCH
      armhf

    3. Avatar for Emmet
      Emmet on
      Editor

      Hi Poing,

      This indicates that you are likely running a 32-bit operating system. Unsure why the arch command still reports aarch64, but that could be due to the way the Raspberry Pi foundation runs the 64-bit kernel on the Pi 4 and newer even if you are running a 32-bit system.

      You could potentially get around this without having to re-install the operating system by adding “aarch64” as a supported architecture. I haven’t attempted this myself but technically it might work.

      sudo dpkg --add-architecture arm64

      After running this command, you will also need to update the package list cache before attempting to install the Sublime text editor.

      sudo apt update

      Otherwise, you will need to install a fresh copy of Raspberry Pi OS and ensure that you select the 64-bit variant.

      Kind regards,
      Emmet

  2. Avatar for poing leve
    poing leve on

    Hi, your site is excellent, however, I get this message after the installlation command: Impossible to find the sublime-text package.
    However, the apt-key list command does indicate a gpg key, and the sources.list.d folder does contain “sublime-text.list”.
    Any other ideas?

    1. Avatar for Emmet
      Emmet on
      Editor

      Hi Poing,

      That is definitely strange, do you know if you are running a 64-bit operating system? That’s the only big reason I could see why the package would be missing.

      Kind regards,
      Emmet