Software >> OS >> Unix >> Linux >> Ubuntu >> How to install Sublime Text (editor)

 

Ubuntu 20.04

The following steps were based on this article.  But if you just followed that article blindly, you may not realize if MAY not work.

The steps below include additional checks at the critical step to ensure we can enable the sublime repository
 


## refresh your repositories

sudo apt update


## install dependencies necessary to add a new repository

sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common


## download the GPG keys for the new repository to be added
## the following step is key, you may not realise it does not work

curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -


## The default Ubuntu install DOES NOT INSTALL curl by default
## So a better way is to confirm curl is present before running the above

sudo which curl


## if the path to curl binary is not shown, then install curl first

sudo apt install curl -y  


## then go back and repeat

curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -


## followed by adding the repository

sudo add-apt-repository "deb https://download.sublimetext.com/ apt/stable/"


## confirm that the sublime repository was added to the apt repository sources

grep ^deb.*sublime /etc/apt/sources.list


## you should get the following output (this is an output, don't execute this)

deb https://download.sublimetext.com/ apt/stable/


## if all above checks have passed, then install sublime

sudo apt install sublime-text