How to install Sublime Text on Linux Mint

How to install Sublime Text on Linux Mint

Sublime Text is a popular, lightweight text editor known for its speed and versatility. It’s an excellent tool for developers, writers, and anyone who needs a robust text editor. In this article, you’ll learn how to install Sublime Text on Linux Mint. The process is straightforward, and this guide will walk you through each step.

Step 1: Update Your System

Before installing any new software, it’s a good idea to update your system. This ensures that you have the latest packages and dependencies. Open a terminal window by pressing Ctrl + Alt + T. Then, enter the following commands:

sudo apt update sudo apt upgrade -y 

The sudo apt update command refreshes the package list to the latest versions. The sudo apt upgrade -y command upgrades all the installed packages on your system to their latest versions.

Step 2: Install Dependencies

Sublime Text requires some dependencies to function correctly. These dependencies are typically already installed, but it’s good to check. Install them using the following command:

sudo apt install apt-transport-https ca-certificates curl software-properties-common -y 

This command installs several tools needed to download and manage software packages over the internet.

Step 3: Add Sublime Text’s Official GPG Key

Adding the GPG key ensures that the software you’re installing is authentic and hasn’t been tampered with. Enter the following command to add Sublime Text’s GPG key:

curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | sudo gpg --dearmor -o /usr/share/keyrings/sublimehq-archive-keyring.gpg 

This command downloads Sublime Text’s GPG key and stores it securely on your system.

Step 4: Add the Sublime Text Repository

Now, you need to add the Sublime Text repository to your system. This repository contains the latest version of Sublime Text. Use the following command:

echo "deb [signed-by=/usr/share/keyrings/sublimehq-archive-keyring.gpg] https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list 

This command tells your system where to find the Sublime Text package.

Step 5: Install Sublime Text

With the repository added, you can now install Sublime Text. First, update your package list again to include the new repository:

sudo apt update 

Then, install Sublime Text by running the following command:

sudo apt install sublime-text -y 

This command installs the latest stable version of Sublime Text on your system.

Step 6: Launch Sublime Text

After installation, you can launch Sublime Text from the terminal or the application menu.

To start it from the terminal, type:

subl 

You can also find Sublime Text in the application menu under “Programming” or by searching for “Sublime Text.”

Step 7: Optional – Create a Desktop Shortcut

Creating a desktop shortcut for easy access to Sublime Text is a good idea. Here’s how to do it:

  1. Right-click on your desktop and select “Create a new launcher here.”
  2. In the dialog box, fill in the fields as follows:
    • Name: Sublime Text
    • Command: subl
    • Comment: A sophisticated text editor for code, markup, and prose.
  3. Click “OK” to create the shortcut.

Now, you can double-click the shortcut on your desktop to launch Sublime Text quickly.

Step 8: Customize Sublime Text

Sublime Text is highly customizable. You can adjust its appearance, behavior, and functionality with various settings and packages. Here’s a brief overview of customization options:

1. Install Package Control

Package Control is a package manager for Sublime Text. It makes it easy to install and manage plugins. To install Package Control:

  1. Open Sublime Text.
  2. Press Ctrl + Shift + P to open the Command Palette.
  3. Type Install Package Control and press Enter.

Once installed, you can access it via the Command Palette to install other plugins.

2. Change the Theme

Sublime Text comes with several themes, but you can also install new ones. To change the theme:

  1. Press Ctrl + Shift + P.
  2. Type UI: Select Theme and choose a theme from the list.

You can install additional themes using Package Control.

3. Install Useful Packages

Some popular packages for developers include:

  • Emmet: Speeds up HTML and CSS workflows.
  • SublimeLinter: A framework for linting code.
  • GitGutter: Shows git changes in the gutter.

To install these packages, use the Package Control:

  1. Press Ctrl + Shift + P.
  2. Type Package Control: Install Package.
  3. Search for the package name and press Enter to install it.

Step 9: Uninstalling Sublime Text (If Needed)

If you ever need to uninstall Sublime Text, you can do so easily. Open a terminal and enter the following command:

sudo apt remove sublime-text -y 

This command removes Sublime Text from your system.

If you also want to remove the Sublime Text repository, use the following command:

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

And then, to remove the GPG key:

sudo rm /usr/share/keyrings/sublimehq-archive-keyring.gpg 

Finally, clean up any unused packages:

sudo apt autoremove -y 

Conclusion

Installing Sublime Text on Linux Mint is a simple process. By following the steps outlined in this guide, you can have Sublime Text up and running in no time. This powerful text editor can significantly improve your productivity, whether you’re coding, writing, or editing text. Plus, with its extensive customization options, you can tailor Sublime Text to suit your needs perfectly. Happy coding!

Fedya Serafiev

Fedya Serafiev

Fedya Serafiev owns the website linuxcodelab.eu. He finds satisfaction in helping people solve even the most complex technical problems. His current goal is to write easy-to-follow articles so that such problems do not arise at all.

Thank you for reading the article! If you found the information useful, you can donate using the buttons below: