SublimeText does not store its settings and plugins (at least those you downloaded using PackageControl) in the same directory as the editor itself (
/usr/lib/sublime-text-2 in your case) - the settings are stored in
/home/(yourusername)/.config/sublime-text-2/, so they won't be overridden when you install a new version.
But, just in case, you can make a backup copy of your current install before unpacking. Something like this would do:
sudo mv /usr/lib/sublime-text-2 /usr/lib/sublime-text-2.old
sudo tar jxf "/var/cache/sublime-text-2/Sublime Text 2 Build 2181.tar.bz2" /usr/lib
Just to note: installing stuff from tarballs into
/usr is very wrong, if you must use system directories use
/opt at least. Otherwise SublimeText runs just fine from a location in your home directory. Here I wrote a bit more on the matter: https://askubuntu.com/a/172753/14564
The solution provided by Anwesha will work but you will have to manually make sublime text your default opening application for all file formats.
What worked for me in 17.10 was the following:
First what you need is the path to the executable file for sublime text
I have ST 3 and it was at
Then open your terminal and use the following commands:
sudo update-alternatives --install /usr/bin/gnome-text-editor gnome-text-editor /path/to/executablesublime 100
sudo update-alternatives --config gnome-text-editor
This will bring up a list of the available alternatives, where the default is marked by an asterisk. If sublime text is not it, then select it now by entering corresponding number. Make sure sublime-text's priority is the highest.
And you're done! Hope this helps :D
These instructions assume that you have installed Sublime Text 3 using the
.debfile provided for Ubuntu. If you downloaded the tarball and installed it manually, you will need to change the paths below to your install location.
First, make sure that
sublime-text.desktopon some systems):
Search for all instances of
geditand replace them with
sublime_text. Save the file, log out and back in, and you should be all set.
If for some reason
sublime-text.desktop) doesn't exist, create it:
Open it in Sublime:
and paste the following into it:
However, if you installed Sublime Text using the
.debfile downloaded from sublimetext.com, the file should already exist.