Prefer installing Sublime Text via the official .deb package rather than using the containerized Snap package? Here’s how to install it in Ubuntu 20.04 the official way via the apt repository.
Open terminal either by pressing Ctrl+Alt+T on keyboard or by searching for ‘terminal’ from your system application menu. When it opens, run following commands one by one to install the latest Sublime Text 3 in Ubuntu.
1.) Download and install the GPG key by running command:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
Type user password when it prompts and hit Enter to continue.
And enable apt is set up to work with https sources via command:
sudo apt install apt-transport-https
2.) Add the official Sublime Text repository via command:
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
3.) Finally refresh system package cache and install the text editor via commands:
sudo apt update sudo apt install sublime-text
And you’ll receive future updates along with system updates through Software Updater (Update Manager).
How to Uninstall Sublime Text:
To remove the apt repository, launch Software & Updates and go to Other Software tab, there remove the repository line.
And to remove the Sublime Text editor, simply run command:
sudo apt remove --autoremove sublime-text