Raspberry Pi

How to Install Sublime Text on Raspberry Pi OS

Sublime Text is a shareware cross-platform source code editor used for writing and editing codes in multiple languages such as Python, C, C++, Java, JavaScript, HTML/CSS and more. It has many packages and plugins that enable users to do whatever they want during the coding process. It also allows you to open several documents simultaneously by organizing them in the form of a tab, making it easier for you to switch to another tab at any time.

In this blog, you will learn how to install Sublime Text on Raspberry Pi OS and start writing your codes on it.

Install Sublime Text on Raspberry Pi OS

You cannot install Sublime Text directly on your Raspberry Pi OS because its repository isn’t included in the official Raspberry Pi source list and to install them, you should need to perform the following steps:

Step 1: Update Raspberry Pi Packages

Before performing any installation procedure, you must need to check whether the current packages on Raspberry Pi are updated and this can be done by applying the following command:

$ sudo apt update -y

If in case the Raspberry Pi packages are not up to date, you can apply the below-given command to upgrade them:

$ sudo apt upgrade -y

Step 2: Add Sublime Text GPG Key

Once the packages are upgraded, you can run the following command for adding the Sublime Text GPG key on Raspberry Pi.

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

Step 3: Add Sublime Text Repository

Next, you have to add a Sublime Text repository using the following command as this will help you install the stable release of the application on Raspberry Pi:

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

Step 4: Update Raspberry Pi Source List

After successfully adding the Sublime Text repository, you have to update the Raspberry Pi source list through the below-mentioned command:

$ sudo apt update

Step 5: Install Sublime Text on Raspberry Pi

Once the source list is updated, you are good to install Sublime Text on Raspberry Pi by adding the following command:

$ sudo apt install sublime-text -y

Step 6: Run Sublime Text on Raspberry Pi

There are two ways to run Sublime Text on Raspberry Pi, you can run it through the terminal using the command “subl” or open it from the desktop main menu by going into the “Programming” section.

Removing Sublime-Text from Raspberry Pi

In case you are not interested in using Sublime-Text from Raspberry Pi, you can remove it through the following command:

$ sudo apt remove sublime-text -y

Conclusion

Sublime Text is a robust source code editor that supports various programming languages and many plugins. You can complete its installation on Raspberry Pi by adding the GPG key and repository to the packages list of the Raspberry Pi system, and you can use this platform to write and edit codes on it.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.