Introduction
Sublime Text is a sophisticated text editor that offers a rich feature set ideal for developers, writers, and anyone who frequently works with text or code. Its speed, versatility, and beautiful interface make it a popular choice among professionals in various fields. While initially developed for macOS and Windows, it is now readily available for Linux-based operating systems, including Ubuntu 20.04, one of the most widely used distributions in the Linux community. This guide will walk you through the installation process of Sublime Text on Ubuntu 20.04, ensuring you start coding or writing with this powerful tool quickly and efficiently.
System Requirements
Before diving into the installation process, it’s essential to ensure that your system meets the basic requirements for running Sublime Text. While Sublime can run on a range of systems, it’s always wise to verify:
- Operating System: Ubuntu 20.04 (Focal Fossa) or later.
- Architecture: 64-bit version is preferred, as most modern systems are 64-bit.
- Dependencies: An active internet connection for downloading packages.
- Memory: At least 1 GB of RAM, although 2 GB or more is recommended for optimal performance.
Installation Methods
There are several methods for installing Sublime Text on Ubuntu 20.04, including using the APT package manager, Snap, and downloading the .deb package. We will explore each method to give you a comprehensive understanding of how to install this robust text editor.
Method 1: Installing via APT Package Manager
The APT package manager is one of the simplest ways to install software on Ubuntu. This method involves adding the Sublime Text repository to your system, which will allow you to keep Sublime Text updated seamlessly.
Step 1: Add the Sublime Text Repository
Open a Terminal: You can do this by searching for “Terminal” in your applications or pressing
Ctrl+Alt+T.Install the GPG Key:
Run the following command to import the Sublime Text GPG key:bash
wget -qO – https://download.sublimetext.com/sublimehq.gpg | sudo apt-key add –Add the Repository:
Next, you need to add the Sublime Text repository to your system sources. Run the following command:bash
echo “deb https://download.sublimetext.com/ apt/stable/” | sudo tee /etc/apt/sources.list.d/sublime-text.list
Step 2: Update Package Lists
Before proceeding with the installation of Sublime Text, update your package lists to include the latest from the newly added repository:
bash
sudo apt update
Step 3: Install Sublime Text
Finally, install Sublime Text by issuing the following command:
bash
sudo apt install sublime-text
After the installation completes, you can start Sublime Text by searching for it in your application menu or typing subl in the terminal.
Method 2: Installing via Snap
Snap is a packaging system that simplifies the installation of software across various distributions of Linux. If you prefer using Snap, this is a convenient method.
Step 1: Install Snap (if not already installed)
Snap comes pre-installed on Ubuntu 20.04; however, if for any reason it isn’t, you can easily install it using:
bash
sudo apt install snapd
Step 2: Install Sublime Text Using Snap
To install Sublime Text using Snap, simply run the following command:
bash
sudo snap install sublime-text –classic
The --classic flag is necessary to grant Sublime Text access to your system as it operates under classic confinement.
Method 3: Installing Using .deb Package
If you prefer more control over the installation process, you can download and install a .deb package directly from the Sublime Text website.
Step 1: Download the .deb Package
Visit the Sublime Text download page and download the .deb package for Ubuntu.
Step 2: Install the Package
Once the download is complete, navigate to the directory containing the .deb file. Use the following command to install Sublime Text:
bash
sudo dpkg -i sublime-text_build-*.deb
If there are missing dependencies, rectify them with this command:
bash
sudo apt install -f
Launching Sublime Text
Once installed, you can launch Sublime Text in several ways:
- From the Application Menu: Simply search for “Sublime Text” in your applications.
- From the Terminal: Type
subland hit Enter. - Creating a Desktop Entry: If you wish to create a shortcut on your desktop or taskbar, you can usually find the options available in the application menu.
Basic Configuration
After launching Sublime Text, you may want to customize it to suit your workflow. Here are a few tips to get you started:
Themes and Color Schemes
Sublime Text offers various themes and color schemes. You can change these by navigating to:
- Preferences > Color Scheme: Choose from built-in options or install custom packages via the Package Control.
- Preferences > Themes: Similar to color schemes, you can choose different themes here.
Package Control
Package Control is an essential tool that enables the installation of third-party packages. To install it:
Open the console in Sublime Text by pressing `Ctrl + “ .
Paste the following command:
python
import urllib.request,os,hashlib; h = ‘…’; pf = ‘Package Control.sublime-package’; ipp = sublime.installed_packages_path(); urllib.request.install_opener(urllib.request.build_opener(urllib.request.ProxyHandler())); open(os.path.join(ipp, pf), ‘wb’).write(urllib.request.urlopen(‘http://sublime.wbond.net/‘ + pf.replace(‘ ‘, ‘%20’)).read())(You can find the latest command from the Package Control website).
After installation, you can access Package Control via:
- Preferences > Package Control, providing a myriad of options for customization and extensions.
Conclusion
Installing Sublime Text on Ubuntu 20.04 is a straightforward process that can be accomplished through various methods tailored to suit different user preferences. Once installed, Sublime Text provides a powerful platform for coding and writing, equipped with numerous features that enhance productivity and workflow.
FAQs
1. Can Sublime Text be used for programming languages other than those it supports by default?
Yes, Sublime Text is highly extensible. You can install plugins for numerous programming languages, enabling syntax highlighting and other features tailored to the specific programming languages you may be working with.
2. How do I update Sublime Text once it’s installed?
If you installed Sublime Text via APT, you can update it by simply running sudo apt update followed by sudo apt upgrade. For Snap installations, use sudo snap refresh sublime-text.
3. Is Sublime Text free to use?
Sublime Text is free to download and evaluate; however, it does prompt users to purchase a license to utilize it without interruptions indefinitely.
4. What are some popular packages I can install with Package Control?
Some popular packages include Emmet for web development, GitGutter for version control integration, and Sublime Linter for real-time code linting.
5. How can I uninstall Sublime Text?
To uninstall Sublime Text, you can use the command sudo apt remove sublime-text if installed via APT, or sudo snap remove sublime-text if installed via Snap.
6. Can I customize keyboard shortcuts in Sublime Text?
Yes, Sublime Text allows extensive customization of keyboard shortcuts. You can do this by navigating to Preferences > Key Bindings to modify or create your own key binds.
