How to Install Sublime Text 3 on Ubuntu

Installing Sublime Text 3 on Ubuntu is a great way to enhance your coding experience. Sublime Text 3 is a popular text editor that offers a wide range of features, such as syntax highlighting, code completion, and customization options. Whether you’re a beginner or an experienced developer, having Sublime Text 3 on Ubuntu can greatly improve your productivity and efficiency. In this blog post, we will guide you through the step-by-step process of installing Sublime Text 3 on Ubuntu, as well as provide you with some additional tips and FAQs to help you get started.

Video Tutorial:

The Challenge of Installing Sublime Text 3 on Ubuntu

Installing Sublime Text 3 on Ubuntu can be a bit challenging for some users, especially if they are not familiar with the command line interface. One of the main reasons why users may face challenges during the installation process is because Sublime Text 3 is not available in the official Ubuntu software repositories. However, this doesn’t mean that installing Sublime Text 3 on Ubuntu is impossible. In fact, there are several methods that you can use to successfully install Sublime Text 3 on Ubuntu. In the following sections, we will discuss these methods in detail, along with the steps and prerequisites for each method.

Things You Should Prepare for

Before you start installing Sublime Text 3 on Ubuntu, there are a few things that you should prepare for. These include:

1. An active internet connection: Make sure that you have a stable internet connection before you begin the installation process. This is important because some of the methods will require you to download files from the internet.

2. Access to the command line interface: Some of the installation methods will require you to use the command line interface to execute commands. Therefore, it is important to have access to the command line interface on your Ubuntu system.

Method 1: via Package Manager

Method 1 is one of the easiest ways to install Sublime Text 3 on Ubuntu. This method involves using the package manager to install Sublime Text 3. Here are the steps to install Sublime Text 3 via the package manager:

Step 1: Open the terminal on your Ubuntu system.

Step 2: Update the package lists and upgrade any existing packages by running the following command:
"`
sudo apt update && sudo apt upgrade
"`

Step 3: Install the necessary dependencies by running the following command:
"`
sudo apt install apt-transport-https ca-certificates curl software-properties-common
"`
Step 4: Import the GPG key used for signing packages by running the following command:
"`
curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | sudo gpg –dearmor -o /etc/apt/trusted.gpg.d/sublime.gpg
"`

Step 5: Add the Sublime Text 3 repository to the package manager by running the following command:
"`
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
"`

Step 6: Update the package lists by running the following command:
"`
sudo apt update
"`

Step 7: Install Sublime Text 3 by running the following command:
"`
sudo apt install sublime-text
"`

Pros:
– Easy installation process.
– Allows for easy updates via the package manager.
– Officially supported by Sublime Text.

Cons:
– May not always have the latest version of Sublime Text 3 available.

Method 2: via Snap

Method 2 involves installing Sublime Text 3 via Snap. Snap is a package management system developed by Canonical, the company behind Ubuntu. Installing Sublime Text 3 via Snap is a straightforward process. Here are the steps to install Sublime Text 3 via Snap:

Step 1: Open the terminal on your Ubuntu system.

Step 2: Install Snap if it is not already installed by running the following command:
"`
sudo apt update && sudo apt install snapd
"`

Step 3: Install Sublime Text 3 via Snap by running the following command:
"`
sudo snap install sublime-text
"`

Pros:
– Easy installation process.
– Allows for easy updates via Snap.
– Provides a sandbox environment for added security.

Cons:
– May not always have the latest version of Sublime Text 3 available.
– Snap packages may have larger file sizes compared to other methods.

Method 3: via Tarball

Method 3 involves installing Sublime Text 3 via a tarball. A tarball is an archive file that contains the source code or binaries of a software application. Installing Sublime Text 3 via a tarball gives you more control over the installation process. Here are the steps to install Sublime Text 3 via a tarball:

Step 1: Open the terminal on your Ubuntu system.

Step 2: Download the latest tarball for Sublime Text 3 by running the following command:
"`
wget -qO – https://download.sublimetext.com/sublime_text_3_build_3211_x64.tar.bz2 | tar -xj
"`

Step 3: Move the extracted directory to the appropriate location on your system by running the following command:
"`
sudo mv sublime_text_3 /opt/
"`

Step 4: Create a symbolic link for Sublime Text 3 by running the following command:
"`
sudo ln -s /opt/sublime_text_3/sublime_text /usr/bin/sublime
"`

Step 5: Create a desktop launcher for Sublime Text 3 by running the following command:
"`
echo -e ‘[Desktop Entry]\nVersion=1.0\nName=Sublime Text 3\nGenericName=Text Editor\nComment=Sophisticated text editor for
code,markup and prose\nExec=/opt/sublime_text_3/sublime_text\nTerminal=false\nType=Application\nIcon=/opt/sublime_text_3/Icon/128×128/sublime-text.png\nCategories=TextEditor;Development;\nStartupNotify=true’ | sudo tee /usr/share/applications/sublime_text.desktop
"`

Step 6: Allow execution permissions for the desktop launcher by running the following command:
"`
sudo chmod +x /usr/share/applications/sublime_text.desktop
"`
Pros:
– Gives you more control over the installation process.
– Allows for easy customization of the installation.

Cons:
– Requires manual updates.
– May have compatibility issues with system updates.

Method 4: via PPA

Method 4 involves installing Sublime Text 3 via Personal Package Archives (PPA). A PPA is a software repository that is maintained by individuals or teams and not officially supported by Ubuntu. Installing Sublime Text 3 via PPA provides you with the latest updates and features. Here are the steps to install Sublime Text 3 via PPA:

Step 1: Open the terminal on your Ubuntu system.

Step 2: Add the Sublime Text 3 PPA to your system by running the following command:
"`
sudo add-apt-repository -y ppa:webupd8team/sublime-text-3
"`

Step 3: Update the package lists by running the following command:
"`
sudo apt update
"`

Step 4: Install Sublime Text 3 by running the following command:
"`
sudo apt install sublime-text-installer
"`

Pros:
– Provides the latest version of Sublime Text 3.
– Easy installation process.

Cons:
– Not officially supported by Sublime Text.
– May have compatibility issues with system updates.

Why Can’t I Install Sublime Text 3?

There can be several reasons why you may encounter difficulties when installing Sublime Text 3 on Ubuntu. Here are a few possible reasons and their fixes:

1. Missing dependencies: If you encounter an error related to missing dependencies, make sure to install the necessary dependencies before proceeding with the installation. Refer to the method you are using for the specific steps to install the required dependencies.

2. Outdated package lists: If you are installing Sublime Text 3 via the package manager or PPA method and encounter an error related to outdated package lists, make sure to update the package lists by running the appropriate command mentioned in the method.

3. Incorrect command execution: Double-check the commands you are executing to ensure that they are correct. Mistyped commands or missing characters can result in installation errors. Try copying and pasting the commands from the instructions to avoid any typos.

Additional Tips

Here are some additional tips to help you get started with Sublime Text 3 on Ubuntu:

1. Customize your settings: Sublime Text 3 offers a wide range of customization options. Take some time to explore the settings and customize the editor to suit your preferences. From changing themes to configuring key bindings, the possibilities are endless.

2. Install plugins: Sublime Text 3 has a vast collection of plugins that can enhance your coding experience. Whether you need syntax highlighting for a specific programming language or additional functionality, installing plugins can greatly improve your productivity.

3. Utilize keyboard shortcuts: Sublime Text 3 is known for its extensive list of keyboard shortcuts. Take the time to learn and memorize some of the most commonly used shortcuts to speed up your coding workflow.

5 FAQs about Installing Sublime Text 3 on Ubuntu

Q1: Can I install Sublime Text 3 on other Linux distributions?

A: Yes, Sublime Text 3 is available for other Linux distributions as well. The installation process may vary slightly depending on the distribution, but the overall steps should be similar.

Q2: Can I use Sublime Text 3 for free?

A: Yes, you can use Sublime Text 3 for free, but you will receive occasional pop-up reminders to purchase a license. A license can be purchased to remove the pop-up reminders and support the development of Sublime Text.

Q3: Can I use Sublime Text 3 for web development?

A: Yes, Sublime Text 3 is a popular choice for web development. It offers features such as syntax highlighting, autocomplete, and a wide range of plugins that can greatly assist with web development tasks.

Q4: Can I install Sublime Text 3 alongside other text editors?

A: Yes, you can install Sublime Text 3 alongside other text editors on your Ubuntu system. Sublime Text 3 will not interfere with other text editors, and you can choose which editor to use for different projects.

Q5: How often does Sublime Text 3 receive updates?

A: Sublime Text 3 is regularly updated with new features and bug fixes. Updates are released periodically, and you can check for updates within the Sublime Text 3 application or via the package manager method.

In Conclusion

Installing Sublime Text 3 on Ubuntu can greatly enhance your coding experience. Whether you prefer the ease of the package manager method or the control of the tarball method, there are several ways to install Sublime Text 3 on Ubuntu. By following the steps outlined in this blog post, you should be able to successfully install Sublime Text 3 and start enjoying its powerful features. Remember to customize your settings, install plugins, and utilize keyboard shortcuts to make the most out of Sublime Text 3. Happy coding!