Install Sublime Text on Ubuntu 22.04: Best Text Editor
In this comprehensive guide, we’ll walk you through the process of installing Install Sublime Text on Ubuntu 22.04 from the command line. Sublime Text is a renowned code editor favored for its speed, versatility, and a rich set of features. Its support for numerous programming languages, including C++, Python, Ruby, and Java, makes it a go-to choice for developers across various domains.
This tutorial, brought to you by Orcacore, will guide you through setting up Sublime Text on your Ubuntu 22.04 system by adding the official stable repository. This method ensures you receive updates and benefit from a reliable installation.
To successfully install Install Sublime Text on Ubuntu 22.04, you’ll need access to your Ubuntu server as a non-root user with sudo
privileges. If you haven’t already configured this, you can refer to Orcacore’s guide on Initial Server Setup with Ubuntu 22.04.
Now, let’s dive into the installation process:
Step 1 – Import Sublime Text GPG Key on Ubuntu 22.04
The first step is to import the GPG key. This key is used to verify the authenticity of the Sublime Text packages. Execute 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
This command downloads the GPG key from the official Sublime Text website, de-armors it, and then saves it to the /etc/apt/trusted.gpg.d/
directory. The > /dev/null
part suppresses any output from the tee
command.
Step 2 – Add Sublime Text Stable Repo to Ubuntu 22.04
Next, you need to add the Sublime Text repository to your system’s package sources. This allows apt
to find and install Sublime Text. The Sublime Text repository contains packages for both x86-64 and arm64 architectures. Sublime Text provides two repositories: Stable and Dev. The Dev repository is intended for users with a purchased license.
Since we’re aiming for the free version, we’ll 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
This command adds a new entry to the /etc/apt/sources.list.d/sublime-text.list
file, specifying the location of the Sublime Text stable repository.
Step 3 – Installing Sublime Text from Terminal on Ubuntu
Now that you’ve added the repository, update your system’s package lists and install the libgl1
package. These steps are crucial for ensuring that Sublime Text can be installed correctly. Run the following commands:
sudo apt update
sudo apt install libgl1
Finally, install Sublime Text using the following command:
sudo apt install sublime-text -y
The -y
flag automatically answers "yes" to any prompts during the installation process.
Verify your installation by checking the Sublime Text version:
subl -version
**Output**
Sublime Text Build 4152
This output confirms that Sublime Text has been successfully installed and displays the build number.
Step 4 – Access Sublime Text Software
You can now access Sublime Text from the Ubuntu terminal or through the desktop application finder. To launch it from the terminal, use the following command:
subl
Alternatively, search for "Sublime Text" in your desktop application menu and click on the icon to launch the application.
Upon launching Sublime Text, you’ll be greeted with the editor’s interface.
[Image of Sublime Text Editor Screen]
From within Sublime Text, you can customize its appearance and functionality by adding plugins and themes through the "Preferences" tab. You can also easily adjust the font size using the CTRL +
and CTRL -
keys.
One of Sublime Text’s most compelling features is its package management system. To install packages, navigate to "Tools" > "Command Palette" and type "Install Package." This will open a package manager where you can search for and install various plugins to enhance your coding experience.
For more in-depth information, consult the official Sublime Text Documentation.
Is Sublime Text free for Ubuntu?
Sublime Text offers a free evaluation period. You can use the software indefinitely; however, a prompt will occasionally appear asking you to purchase a license. To use the paid version, you can use 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 the command-line tool provided by Sublime Text. It allows you to open files, create new files, and perform other actions directly from the terminal. This is incredibly useful for quickly editing files without having to navigate through the GUI.
Is Sublime Text good for Python?
Sublime Text is an excellent choice for Python development. It offers syntax highlighting, code completion, and various plugins specifically designed for Python. Its speed and responsiveness make it a popular option among Python developers.
Conclusion
In this guide, you’ve learned how to Install Sublime Text on Ubuntu 22.04 from the terminal using the stable repository. While the software offers a free evaluation period, purchasing a license ensures continued access to the latest features and support.
We hope you find Sublime Text a valuable tool in your development workflow.
You might also find these articles interesting:
What sudo apt update and upgrade Do on Ubuntu / Debian
Install Sublime Text on AlmaLinux
Install and Uninstall OpenRGB from Ubuntu
Alternative Installation Methods for Install Sublime Text on Ubuntu 22.04
While the method described above, using the official repository, is generally recommended, here are two alternative approaches you can consider for Install Sublime Text on Ubuntu 22.04:
1. Using Snap Package Manager:
Snap is a universal package manager developed by Canonical (the company behind Ubuntu). It allows you to install applications in a sandboxed environment, which can improve security and dependency management.
Explanation:
Snaps are self-contained packages that include all the necessary dependencies to run an application. This eliminates dependency conflicts and simplifies the installation process. However, Snap packages tend to be larger than traditional apt
packages. The snap store may not always have the latest version.
Installation Steps:
-
Update Snap: Ensure your snapd service is up-to-date.
sudo snap refresh
-
Install Sublime Text: Use the
snap install
command to install Sublime Text.sudo snap install sublime-text
-
Launch Sublime Text: Once the installation is complete, you can launch Sublime Text from the application menu or by running the following command in the terminal:
sublime-text
2. Downloading and Installing the .deb Package Directly:
Another method is to download the .deb
package directly from the Sublime Text website and install it using dpkg
.
Explanation:
This method provides more control over the installation process. You download the specific version you want and install it manually. However, you’re responsible for managing dependencies yourself. This method might not automatically provide updates to sublime text.
Installation Steps:
-
Download the .deb Package: Visit the Sublime Text website (https://www.sublimetext.com/) and download the appropriate
.deb
package for your system architecture (usually x86-64). -
Install the .deb Package: Navigate to the directory where you downloaded the package and run the following command:
sudo dpkg -i sublime-text_build-xxxx_amd64.deb #Replace with downloaded filename
-
Fix Dependencies (if necessary): If you encounter any dependency errors, run the following command to resolve them:
sudo apt-get install -f
-
Launch Sublime Text: After successful installation, you can launch Sublime Text from the application menu or by typing
subl
in the terminal.
These alternative methods offer different approaches to Install Sublime Text on Ubuntu 22.04, each with its own advantages and disadvantages. Choose the method that best suits your needs and preferences.