I am trying to install Sublime through the following command. But it returns error.

sudo apt-get install sublime-text-2

but it returns

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package sublime-text-2

Any helps I have not found any similar question and solution for this problem.

And Also 2 is the recent one or version 3 is available.

  • i showed error. its not duplicate , see i tried those steps and getting the error. That's y i am posted a question. – Kvvaradha Dec 9 '15 at 11:07
  • It's sudo apt-get install sublime-text not sudo apt-get install sublime-text-2 – Parto Dec 9 '15 at 13:25

Add the ppa and install as follows:

sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
sudo apt-get install sublime-text
  • still i am getting the same error. Is it any package missing in my installed Ubuntu? – Kvvaradha Dec 9 '15 at 11:18

First, you should be installing Sublime Text 3, not ST2, as it is much more up-to-date with many bug fixes and added features. On the page I linked, select either Ubuntu 64-bit or 32-bit, depending on your system, and save the .deb file to your ~/Downloads directory. Next, run the following commands, where XXXX is the build number:

cd ~/Downloads
sudo dpkg -i sublime-text_build-XXXX_amd64.deb 
# for 64-bit
# or
sudo dpkg -i sublime-text_build-XXXX_i386.deb 
# for 32-bit

This will install ST3 in /opt/sublime_text, put the subl command in /usr/bin/subl, and set up icons properly. You can then follow my answer here on making Sublime the default text editor.

Not the answer you're looking for? Browse other questions tagged or ask your own question.