Reference: http://www.technoreply.com/how-to-install-sublime-text-2-on-ubuntu-12-04-unity/
1. Go to sublime text website download 32-bit Linux compression pack//64-bit I don't know why (Error: Bash:/usr/bin/sublime:cannot execute binary file), My system is vbox in the 64-bit Ubuntu
2. Extract (Extract here), note that after extracting the folder name has a space (that is sublime Text 2), it is recommended to SUBLIMETEXT2, easy to lose command
3. Move the extracted SublimeText2 folder to the/opt folder
sudo mv sublimetext2/opt/
4. Run the following command so that you can open the sublime Text 2 directly at the terminal input sublime
sudo ln-s/opt/sublimetext2/sublime_text/usr/bin/sublime
Note that if you have previously created/usr/bin/sublime, there will be an error (I have previously downloaded 64-bit's sublime to do this again, so this file remains)
ln:failed to create symbolic link '/usr/bin/sublime ': File exists
Use the RM command to remove it, and then rerun the sudo ln command to
sudo rm/usr/bin/sublime
sudo ln-s/opt/sublimetext2/sublime_text/usr/bin/sublime
5. Create a desktop shortcut, first edit the following file with Sublime, command
sudo sublime/usr/share/applications/sublime.desktop
6. Enter the following:
[Desktop Entry]
version=1.0
Name=sublime Text 2
# only KDE 4 seems to use genericname, so we reuse the KDE strings.
# from Ubuntu ' s language-pack-kde-xx-base packages, version 9.04-20090413.
Genericname=text Editor
Exec=sublime
Terminal=false
icon=/opt/sublimetext2/icon/48x48/sublime_text.png
Type=application
Categories=texteditor;ide;development
X-ayatana-desktop-shortcuts=newwindow
[NewWindow Shortcut Group]
Name=new Window
Exec=sublime-n
Targetenvironment=unity
7. You can choose to open the editor in Terminal input Sublime, or click the desktop shortcut to open it.
8. If you want to make a file association, edit the following file
sudo sublime/usr/share/applications/defaults.list
9. Change the Gedit.desktop to Sublime.desktop (it is recommended to back up the contents of this file first)
Ubuntu installation Sublime Text 2.0.2 32-bit Linux