Install Sublime Text on Ubuntu 22.04: Best Text Editor

Posted on

Install Sublime Text on Ubuntu 22.04: Best Text Editor

Install Sublime Text on Ubuntu 22.04: Best Text Editor

In this guide, we aim to walk you through the process of Install Sublime Text on Ubuntu 22.04 from Terminal. Sublime Text stands out as a powerful and remarkably fast code editor, boasting a rich feature set that caters to diverse coding needs. Its versatility allows you to seamlessly code in various programming languages, including C++, Python, Ruby, and Java, among others.

Moreover, Sublime Text’s cross-platform compatibility makes it a valuable tool across different operating systems. In this tutorial, brought to you by Orcacore, you will learn how to set up Sublime Text by adding the stable repository to your Ubuntu 22.04 system and beginning to use it. This makes Install Sublime Text on Ubuntu 22.04 a very simple task.

Before you begin the process to Install Sublime Text on Ubuntu 22.04, ensure that you have access to your server as a non-root user with sudo privileges. If you need guidance on this, refer to this helpful guide on Initial Server Setup with Ubuntu 22.04.

Now, let’s proceed with the steps required to Install Sublime Text on Ubuntu 22.04.

Step 1 – Import Sublime Text GPG Key on Ubuntu 22.04

The initial step involves adding the GPG key to your server. You can achieve this by executing the following wget command in your Ubuntu terminal:

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

Step 2 – Add Sublime Text Stable Repo to Ubuntu 22.04

Next, you need to add the Sublime Text repository to your system. This apt repository encompasses packages for both x86-64 and arm64 architectures. Sublime Text offers two repositories: Stable and Dev. The Dev repository is specifically intended for users with a purchased license.

For free use, you’ll want to add the stable repository using the following command:

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

Step 3 – Installing Sublime Text from Terminal on Ubuntu

At this stage, you must update your system’s package list and install the libgl1 package with the commands shown below:

# sudo apt update
# sudo apt install libgl1

Then, use the command below to Install Sublime Text on Ubuntu 22.04:

sudo apt install sublime-text -y

Verify the installation by checking the Sublime Text version:

subl -version
**Output**
Sublime Text Build 4152

Step 4 – Access Sublime Text Software

Now, you can easily access Sublime Text from the Ubuntu terminal. Simply run the following command:

subl

Alternatively, you can launch Sublime Text from your desktop application finder by searching for the "Sublime Text" app.

Upon launching the application, you’ll see the Sublime Text editor interface.

Sublime Text Editor Screen
install Sublime Text on Ubuntu 22.04

Within Sublime Text, you can easily add plugins and themes through the Preferences tab. You can also adjust the font size using the CTRL + and CTRL – keys.

Another useful feature of Sublime Text is the ability to install packages. To do this, navigate to Tools >> Command Palette >> and type Install Package.

For more detailed information, you can consult the Sublime Text Documentation.

Is Sublime Text free for Ubuntu?

Sublime Text offers a stable repository containing a copy-protected version available for free. However, to continue using the software, you’ll need to register and utilize the Dev repository:

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

What is subl in Ubuntu?

subl is a command-line tool for the Sublime Text editor, enabling you to work with files directly from the command-line interface.

Is Sublime Text good for Python?

Sublime Text supports various programming languages. It is considered a good option for Python development, as it’s written in C++ and Python itself.

Conclusion

You have now successfully learned how to Install Sublime Text on Ubuntu 22.04 from Terminal. You can use the stable repository, which provides a free, copy-protected version. However, continued use of Sublime Text requires purchasing a registered account.

Enjoy using Sublime Text!

You may also be interested in these articles:

What sudo apt update and upgrade Do on Ubuntu / Debian

Install Sublime Text on AlmaLinux

Install and Uninstall OpenRGB from Ubuntu

Alternative Installation Methods

While the above method using the official Sublime Text repository is recommended, there are alternative approaches you can take to Install Sublime Text on Ubuntu 22.04.

1. Using Snap Package Manager

Snap is a universal package manager that works across many Linux distributions. Using Snap provides a sandboxed environment for applications. However, it’s worth noting that Snap packages can sometimes be larger and might have a slightly slower startup time compared to APT packages.

Here’s how to install Sublime Text using Snap:

  1. Update Snap: While Ubuntu 22.04 typically comes with Snap pre-installed, it’s always a good idea to ensure it’s up to date.

    sudo snap refresh
  2. Install Sublime Text: Use the following command to install Sublime Text from the Snap store:

    sudo snap install sublime-text
  3. Verify Installation: You can verify the installation by running:

    sublime-text --version

    This command should output the version of Sublime Text installed via Snap.

Explanation: The snap install sublime-text command downloads and installs the latest version of Sublime Text from the Snap store. Snap handles all the dependencies and configurations required for the application to run smoothly. The main advantage of this method is its simplicity and the automated dependency management. It provides a contained and consistent environment, reducing potential conflicts with other system libraries.

2. Downloading and Installing the .deb Package Manually

Another approach is to download the .deb package directly from the Sublime Text website and install it using dpkg, the Debian package manager. This method provides more control over the installation process, but it requires manually handling any missing dependencies.

  1. Download the .deb Package: Visit the official Sublime Text downloads page and download the .deb package suitable for Ubuntu. Make sure you choose the correct architecture (usually amd64).

  2. Navigate to Download Directory: Open your terminal and navigate to the directory where you downloaded the .deb package. For example, if you downloaded it to your Downloads folder, use:

    cd ~/Downloads
  3. Install the Package: Use the dpkg command to install the package:

    sudo dpkg -i sublime-text_build-4152_amd64.deb # Replace with the actual filename

    Note: Replace sublime-text_build-4152_amd64.deb with the actual filename of the downloaded package.

  4. Fix Dependencies (if necessary): If you encounter any dependency errors during the installation, you can fix them by running:

    sudo apt-get install -f

    This command will attempt to resolve any missing dependencies required by Sublime Text.

  5. Verify Installation: After successful installation, you can verify it by running:

    subl -version

    This will output the version of Sublime Text you have installed.

Explanation: The dpkg -i command installs the .deb package. The -i option specifies that you are installing a package from a file. If dpkg encounters missing dependencies, it will report errors. The sudo apt-get install -f command then tries to fix these broken dependencies by downloading and installing any missing packages. This method is useful when you want more control over the installation or if you prefer not to use package managers like Snap. However, it requires a bit more manual intervention to resolve potential dependency issues.

Leave a Reply

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