This tutorial will show you how to install the Sublime Text editor on the Raspberry Pi.
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
- Raspberry Pi ( Amazon )
- Micro SD Card ( Amazon )
- Power Supply ( Amazon )
- Ethernet Cable ( Amazon ) or Wi-Fi ( Amazon )
- Monitor ( Amazon )
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.
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.).
c. You now have the Sublime Text editor open on your 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.
The arch command gives me the following answer: aarch64.
I think it should be good…
Hi Poing,
Hmm, that is definitely strange then. Could you please try using the following command and let me know what it returns.
Kind regards,
Emmet
Here is the answer to the command :
dpkg-architecture –query DEB_HOST_ARCH
armhf
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.
After running this command, you will also need to update the package list cache before attempting to install the Sublime text editor.
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
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?
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