How to install Sublime Text 2 on Ubuntu 12.04 (Unity)

Sublime Text is an awesome text editor. If you’ve never heard of it, you should check it out right now.

I’ve made this tutorial because there’s no installer for the Linux versions of Sublime Text. While that’s not a real problem, I feel there is a cleaner way to go around this. Also, this post will show you how to integrate Sublime Text to Unity (which, I’m glad to report, has now matured into a fully functional user interface). So let’s get on with this. Here is my how to install Sublime Text on Ubuntu tutorial.

[This tutorial has been updated following feedback from AskUbuntu. Also, you need to do these steps using your login. Do not start by typing “sudo -s”!]

Step 1

Download the tarfile that suits you best and extract it. Here’s the command to extract tar.bz2 files:

tar xf Sublime\ Text\ 2.0.1\ x64.tar.bz2

You’ll notice that I got the 64-bit version. The reason is that it’s lightning fast. So, go for that if you can!

Step 2

You’ll get a “Sublime Text 2” folder after extraction. This folder contains all the files that Sublime Text will need. So we have to move that folder somewhere more appropriate. Like the “/opt/” folder :

sudo mv Sublime\ Text\ 2 /opt/

Step 3

At some point you’d want to be able to call Sublime Text from the Terminal by just typing “sublime”. To do that, we’ll just create a symbolic link in “/usr/bin” like thus:

sudo ln -s /opt/Sublime\ Text\ 2/sublime_text /usr/bin/sublime

Step 4

Now that our files are at the right place, we need to create a launcher in Unity. To do this, we’re going to create a .desktop file in “/usr/share/applications”:

sudo sublime /usr/share/applications/sublime.desktop

And paste the following content:

[Desktop Entry]
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

Icon=/opt/Sublime Text 2/Icon/48x48/sublime_text.png

[NewWindow Shortcut Group]
Name=New Window
Exec=sublime -n

As you can see, these lines are quite straightforward. Go ahead and experiment a bit with them.

Step 5

Now you would probably want to open all text files with Sublime Text 2. The easiest way to do that is to open up the file associations list:

sudo sublime /usr/share/applications/defaults.list

And replace all occurrences of gedit.desktop with sublime.desktop. Tada ! There you go. You now have Sublime Text 2 installed on Unity on Ubuntu 12.04, like a pro. Here are some screenshots:

333 thoughts on “How to install Sublime Text 2 on Ubuntu 12.04 (Unity)”

  1. When I double click sublime_text I get 3 files with “��L@X (invalid encoding)”, “�lS22c (invalid encoding)”, and “!���� (invalid encoding)” as the names and no contents. The editor doesn’t open. If I try to run it through the terminal I get:

    ./sublime_text: 1: ./sublime_text: ELF: not found
    ./sublime_text: 1: ./sublime_text: : not found
    ./sublime_text: 1: ./sublime_text: �@8: not found
    ./sublime_text: 2: ./sublime_text: p��
    �!: not found
    ./sublime_text: 3: ./sublime_text:��: not found
    ./sublime_text: 4: ./sublime_text: ���!�: not found
    ./sublime_text: 4: ./sublime_text: ���
    �: not found
    ./sublime_text: 5: ./sublime_text: Syntax error: word unexpected (expecting “)”)

    Any ideas?

    1. I think it’s because I’m running 32-bit Ubuntu and the Sublime Text package I got was 64-bit. I thought I was running 64-bit Ubuntu. =/

  2. I am running ubuntu 10 on 64 bit. didn’t work for me either. In step 4. sudo sublime, i get an error sublime is not found!

  3. I copied the code for step 4, but I’m still not able to see Sublime’s icon in my desktop launcher. What can be the problem?

  4. When installing this way I can’t seem to install the package manager. When trying to install it I get [Error 13] Permission Denied

  5. Thanks a bunch for this! Worked great in Linux Mint 12 64-bit. (I didn’t try the default file association part, but I’m sure it works too, seeing as Linux Mint is built on Ubuntu and all.)

  6. Worked perfectly on the latest ubuntu.

    Works like a charm. If you dont even read the explanation, it just works..!!! Good job..!

  7. there’s something strange in the sublime version, I have ubuntu 64 bits and of course I downloaded the 64 bits version which didnt work for me…after I tried to run the sublime_text script I got 3 files in the sublime directory with the “invalid encoding” legend same as kevin…I just change the version to 32 bits and this works perfectly….wft?

  8. This worked for me:

    sudo add-apt-repository ppa:webupd8team/sublime-text-2
    sudo apt-get update
    sudo sudo apt-get install sublime-text-2

    Running Ubuntu 12.04 LTS x64

  9. Great Tutorial, The only issues I have found with the install are the following. Maybe someone could provide some incite? I am running this on an 11.10 x64 server OS. Those issues aside the program is fantastic and seems to be fully functional.

    When running sublime from terminal I see the following error:

    myuser@my-server:/usr/local/src$ sublime

    (sublime:10182): Gtk-WARNING **: Unable to locate theme engine in module_path: “pixmap”,

    (sublime:10182): Gtk-WARNING **: Unable to locate theme engine in module_path: “pixmap”,

    (sublime:10182): Gtk-WARNING **: Unable to locate theme engine in module_path: “pixmap”,

    (sublime:10182): Gtk-WARNING **: Unable to locate theme engine in module_path: “pixmap”,

    When opening the console in sublime I see the following error:

    Unable to write session file: /home/myuser/.config/sublime-text-2/Settings/Auto Save Temp Session.sublime_session

  10. Best to not put things like this in /usr/lib, but rather /usr/local/lib instead. /usr/lib is system stuff, /usr/local is for things added by the user.

  11. Very nice worked great once i figured out what bit my system was. uname -m to find out what bit your system is.

  12. Your instructions worked perfectly, but everytime I start Sublime it automatically opens the sublime.desktop file at the same time. This is very annoying. Do you know how to make it stop doing this? Thanks.

  13. If your Icon is not showing up check to make sure the path written inside the sublime.Desktop file for the line that starts with “Icon=” is correct.

    I followed this excellent tutorial but isntalled in /usr/local/bin instead of /usr/lib/ and my Icon was not showing up. I realized then that the path declared inside the .Desktop file for the Icon was probably incorrect.

    Thanks for the excellent tutorial!

  14. I’m not sure at which point Sublime creates its ~/.config/sublime-text-2 directory, but because of doing all your steps as superuser, the configuration is owned by root.
    Not best practise to have these files in your home directory i think (e.g. you cannot save your user settings)

    Afterwards, did something like:
    cd ~/.config/
    chown -R : sublime-text-2/
    (where you put the owner of that home directory)

    1. I also had to do this. Jevin, please include a step in your guide to take ownership of this folder. Otherwise, Sublime won’t open all of your previously opened files, and you won’t be able to edit the files listed in the Preferences menu.

    2. The easiest solution to this problem is to open sublime the first time without a sudo command, it creates these files the first time you start sublime text. So if you start the first time as root the files will be made as root, if you start normally the files will be yours and everything will work normally.

  15. I’ve used your method to install Sublime Text 2, and now I can use this approach for any other similar problem. I thank you for that, you taught me something very valuable.

  16. Thanks, worked great. However sublime doesn’t show up in the application switcher, does anybody know why this might be?

  17. To fix the problem Ollie has, there is a quick fix.
    In the sublime.desktop file you need to declare how the application handles files. So instead of “Exec=sublime” you should put “Exec=sublime %F” which in essence says that sublime text accepts multiple files (“%f” would be a single file and with “u” (same syntax) you say it accepts a single or multiple URLs).
    With this quick fix sublime text will show up in the application switcher and the context menus.

  18. Can you tell us how you do updates since there is no longer a repository? (the unofficial one was deleted very recently)

  19. This takes freaking 3 seconds to do in Windows. In Ubuntu I need 15 minutes and 3 tutorials (this, how to open nautilus in sudo, and how to find my user files in nautilus while started with sudo). Seriously, it’s no wonder why linux hasn’t made it anywhere in the consumer sector so far.

  20. How did you get Sublime to pin to the Application Bar? I can’t seem to figure it out. When I launch it from Terminal, it doesn’t show up like any other app would on the Bar. I can find it in Dash, but I can’t pin it from there.

  21. Hi,

    It worked nicely until I loaded the new version and decided to replace Sublime Text 2 folder with the new one. From that moment I could not run the package anymore with an error message saying :

    Unable to run package setup:

    Traceback (most recent call last):
    File “./”, line 165, in upgrade
    upgradePackage(pkg, pristinedir, datadir, backupdir)
    File “./”, line 158, in upgradePackage
    os.path.join(backupdir, base), inhibitOverwrite)
    File “./”, line 113, in upgradeArchive
    shutil.copy(src, dst)
    File “.\”, line 88, in copy
    File “.\”, line 53, in copyfile
    IOError: [Errno 13] Permission non accordée: u’/home/philippe/.config/sublime-text-2/Pristine Packages/Groovy.sublime-package’

    I then decided to go with ppa but I have exactly the same error message.

    Would you be kind to assist me in trying to understand what is wrong with my configuration ?

    Thanks in adcanve.

    Best regards.

    1. Hi everybody,

      Coming back to you to let you know what I did to solve my problem.
      Delete in .config repository (hidden file in /home) the sublime-text-2 repository.

      That’s all folks.


      Philippe Idlas.

  22. Everything worked fine. Now i want to add new packages. I got some for Rails and it says to move the files to the packages. The only way to do this is from the command line using sudo?

    I can’t drag and drop. Why would this folder be a root permission?

  23. Hello. I followed up your tutorial and i got some problems. I cannot save my personal settings (sublime is saying it cannot save into .config). Additionally, when i close it, it doesn’t remember last modified files, it opens first files that was opened with sublime like “deafults.list”

    1. I’m having the same issue with remembering open files. It will open the first file instead of the files I had open the last time i used sublime. Was there ever any fix to this?

      1. Fixed it. It’s a permissions problem. Do “$ sudo chmod 777 -R ~/.config/sublime-text-2 ” (no quotes, no dollar sign) in the terminal, and you’ll be good to go. Note though, that this is universal read/write, and may not be the most secure… if someone else could offer a more secure setting that’ll work, that’d be great.

        1. Set correct ownership:

          “$sudo chown -R username:username /home/username/.config/sublime-text-2”

          Set correct permissions on files and directories using find and xargs:

          “$sudo find /home/username/.config/sublime-text-2/ -type d | xargs chmod 775”

          “$sudo find /home/username/.config/sublime-text-2/ -type f | xargs chmod 664”

          Of course, omit quotes and dollar sign for commands.

    2. I’m having the same problems. Trying to save personal settings gives me ” Unable to save ~/.config/sublime-text-2/Packages/User/Preferences.sublime-settings”. And when opening Sublime, i’m greeted with the sublime.desktop and defaults.list files, rather than my last opened project. I’m not sure what to do.

  24. Thanks indeed for posting these steps. However, the last step didn’t work for me. Gedit is still the default editor. Also, sublime is not included in the “other apps” list to choose it as a default app. Do you know how to fix this?
    Many thanks,

  25. Hi everyone,

    you see, this is my problem:

    I find sublime “icon” anywhere, also I made the substitution in the defaults.list and this did not work to set sublime as default.

    Any idea?

  26. I have Sublime installed and working just fine with all of the extensions for rails etc.

    Now I would like to update Sublime to the latest version.

    Has anyone done that or can someone give me some direction on how to do this.


    1. I decided to use the WebUpd8team Sublime Text 2 PPA on Ubuntu with the following:

      sudo add-apt-repository ppa:webupd8team/sublime-text-2
      sudo apt-get update
      sudo apt-get remove sublime-text* (optional- I used it since I had a sublime version installed)
      sudo apt-get install sublime-text … this installed the latest version

      I was informed on the Sublime forum that any extensions etc are installed in a seperate folder so updating will not affect those settings.

  27. Thanks for the tutorial. I think there is one step missing that prevents preferences from being saved. I am guessing this is due to steps 4+5 where we run sublime as root. I suspect if we ran it once as a normal user this wouldn’t be an issue, but adding this as step six resolves issue.
    sudo chown -R $USER:$USER $HOME/.config/sublime-text-2/

  28. Great, thanks.

    Only problem I see is icon, when I put 48×48 it is blurred in app switcher (Alt + Tab), when I put 128×128 it is ok in app switcher, but blurred in launcher.

    Any idea?

  29. HI
    I have followed this guide but I am having I problem.

    When I type “sublime” in terminal, thee sublime open app works well and launcher in unity is highlighted correctly.

    Now I made sublime to be my default app for opening C Source Files. ( I used MyUnity App)

    Now whenever I open and C ( ie .c ) file , sublime opens it well but I get no icon in unity for sublime. Also the previous sublime icon which I have used as described in your post is not highlighted.

    Image Attached :

    Please help.


  30. There’s a little problem with permissions here; I just did a `chmod -R 0777 ~/.config/sublime-text-2`. Then preferences are saved and you can install Package Control and activate and all without needing sudo. Also, if you’re using the default Unity and everything, the 128×128 icon works better in the Dash (but it *is* a little fuzzier in the Launcher).

  31. Jevin, this worked beautifully for me. Thank you 🙂

    Sublime launches a lot faster than GEdit for me and obviously buries it in every conceivable way as a serious text editor.

  32. Hi all,

    Had a problem setting Sublime as the default editor for PHP files. The problem was that Sublime does not show up the applications list when selecting ‘Open with other application’.

    Basically all you need to do is edit sublime.desktop:
    sudo sublime /usr/share/applications/sublime.desktop

    then replace:

    Exec=sublime %f

    Found the solution in a similar thread on Nedit:

    Hope this helps!

  33. Pingback: tonyfy
  34. Thanks for the post,

    I want a little thing more that how I can set the .html or other kind of files to be open by default in PHP file.


  35. Everything ran OK. However I ran into a few problems some I worked around. (I am using Ubuntu10.04LTS)
    I ran into difficulty when I tried to change the Icon for the sublime.desktop to the sublime text one. I kept getting u arent the owner. So I tried to change the permissions

    me@home$ sudo -i
    root@ubuntu$ chmod -rw-r–r– sublime.desktop -rwxrwxrwx sublime.desktop

    This changed the permissions to ————- sublime.desktop
    GRRRRRR….. What did I do wrong. I tried to change them back and then to anything else and no dice. I have tried sudo infront of the command while root and still nothing. Till I either get a reply from you or find the answer someplace else I am deleting the directory (which I can only do through the terminal) and going with the regular Icon. I have the Icon set right on the panel I added it too. I just like things to be neat and tidy and this is why I want to have the Icon on the file like all the others do in that folder. I am moving over to Ubuntu from Windows and I want to have the same level (if not greater) of control and ability to modify/do all in the terminal and ubuntu environment. I am transfereing to Ubuntu as well because I am learning to become a developer of android apps and building custom roms and want to work in Linux noit Windows. I just hate the beggining of a learning curve it’s the most tedious as all the information is sorting in my head and starting to make sense and understood. especially when learning new terminology and trying to make links as to the Windows equivalent. Like Windows calls it a cmd.exe linux is terminal. dir is ls etc… Anywho thanks for the how-to I learned a lot and will be applying what i learned for other instances, thanks man.

  36. I just installed the sublime as it was mentioned here on Ubuntu 12.04.

    But every time I open the editor, it opens me sublime.desktop and defaults.list file in it instead of the project, that I was editing before closing the editor.

    Can anyone help me how to solve this?
    I’m quite new to Linux

    1. I noticed the same thing. Not sure why or how, but when you open sublime with root privileges (‘sudo sublime’ in terminal)…if you close sublime with files open these will be open every time you open sublime. So to prevent these two files being open when you start sublime you’ll need to ‘sudo sublime’ and close both of these files, then close Sublime. Now open using the shortcut and you’ll notice that these are no longer open by default.

      Not sure about how to automatically open the last project you were working on, unless you leave it open while logged in with sudo permissions.

      Hope this helps!

  37. In Windows when I notice things like that happening I check the “settings – default” under preferences tab. Sometimes values change or revert after updates or adding new packages (from what I remember happening to me) or get replaced by a backup if they get corrupted (at least I think they do on the last part if not maybe they should lol) Anyway it’s been a while since it happened to me so I may not have total accuraccy on events leading to.
    Moving on, as I was saying I normally edit the settings using sublime. However I noticed that after I moved the files over to usr/lib etc… That I am no longer able to save my changes I think that this may likely be due to the new location that they are in. As messing around in those folders can result in horrid repercutions. I accidentally deleted my whole lib folder because I edited an older saved command and then forgot to add the folder in lib I wanted to delete thereby deleting all of my installed programs. I had to laugh luckily it was only a few days old and not fully setup properly and I save my docs etc… to another partition.

    Anyway there may be something to do with permissions (I am nub too and don’t know for sure) having a part in it. Similar things happens in Windows when opening a game as administrator rather than normally (even if you are using an admin account at the time) your saved games are not listed. It happens more with games than other programs I notice likely due to the relationship with specific users saved files. Before I “installed” sublime to usr/lib I was just using it from the folder where I extracted the folder and everything was running OK. And in reality all you are doing (from what I see) is just extracting the files form the archive then moving them to the OS’s user programs folder, then creating a shortcut to it and putting it’s parameters etc on how it should behave etc… into the OS’s folder where it keeps those files. I have an idea that I think will work and at the same time lessen any potential damage that I can be wrought by my inexperience with Linus and it’s to create a folder where I put all of the programs I download that isn’t in a restricted area like usr/lib and then to create shortcuts to its executable that I can then I add to the panel or to one of the program menus. That way I will still be able to use the program without cluttering up the desktop with shortcuts (which annoy me) and alter any settings from time to time. Or just config the settings before I move everything over to usr/lib. I also have another couple of ideas that may work as well. Anywho I think I have gone on long enough. I anyone has any added input on what I have written or can shed more light on manually installing software via the terminal I am all ears. Have a great day and if I run into any problems with my idea I will post them.

  38. If you want to install sublime text use this:

    With the method above you may experience problems with file permissions. For Example I could not get Package Control to work.
    If you have used the above method you can uninstall it by undoing all your steps in reverse order.

    Hint: Remember to remove ~/.config/sublime-text-2 folder before installing again.

  39. Hi!
    Sorry for my English. This is not my first language.

    Thanks for the instructions. Now I can install ST2 without repo.

    I have a question: how I can to add ST2 in right click context menu? I google it… but all ways – it’s to use “Nautilus Actions” and and similar programs.


  40. I beleive a better method is to install the package via Synaptic. Running “sudo synaptic” and selecting sublime text to install, just makes everythink ok for me.

  41. I did this on Arch Linux and it worked fine, but I moved the install directory from /opt to /usr/lib. I screwed up the link a few times, but other than that, it was great. Thanks!

  42. Hey, just simply add it to your packages for use with your package manager:

    sudo add-apt-repository ppa:webupd8team/sublime-text-2
    sudo apt-get update
    sudo apt-get install sublime-text

  43. Thanks a lot for the clear explanation. I have one question: how can we create an access to the application in the Ubuntu gnome desktop dropdown menu, for example into Applications > Programming?

  44. How can one uninstall Sublime text installed using this tutorial? I’m not sure exactly how one can remove all the connections by doing “reverse.” What commands constitutes reversing? (I’m new to Ubuntu.) For an example of the difficulty I am having, there is sublime-text-2 folder in the home/.config folder. However, when I try commands like “sudo apt-get remove sublime-text-2” from the home/.config folder, I receive an error message “Unable to locate package.”

    On a bigger note, the problems with this tutorial for me were 1) Doesn’t properly install Unity taskbar icon and 2) Terminal becomes unusable after launchiing Sublime and 3) Sublime is not accessible in the software center … which is why I want to uninstall it and use a different installation process.

    1. If you install in ~/opt, link executable to ~/bin/sublime and put your gnome desktop icon info in ~/.local/share/applications/sublime.desktop as described in the AskUbuntu answer here:

      then you can just delete those files/folders (~/opt/Sublime\ Text\ 2, ~/bin/sublime and ~/.local/share/applications/sublime.desktop). DONE!

    2. If you didn’t find an answer yet, here is something, through this tutorial, you manually did set the links to get the application integrated to the desktop, to remove the application you just need to do the inverse process, actually any order can serve to the purpose, the only thing you really need to do is undo the last step, replace the occurrences of sublime.desktop by gedit.desktop so the default application for all those file-types is not sublime.

      * If you remove the sublime.desktop file in /usr/share/applications/ you remove the icon from unity.
      * If you remove the soft link at /usr/bin/sublime, you automatically remove it from your PATH, so when you type sublime in your terminal an error will prompt and Sublime wont be launched.
      * If you erase or remove the Sublime Text 2 folder from /opt/ you are actually removing the application info from your computer, this operation will free the hard disk space.

  45. Can anyone tell me why the fuck you people use all this unix crap instead of Microsoft. Can we please nuke unix and all associated sofware?

        1. I’ll try again tomorrow to install a text editor on my &$^#^#&@ virtual piece of crap unix box. Was unable to acccomplish it today. But thanks for the tutorial.

  46. Hey, if you replace



    Exec=sublime %f

    It will allow you to open files using right-click > Open With in Nautilus. It can be useful.

  47. Thanks for updating your site to conform with this AskUbuntu post [1]. I wish you would change steps 3, 4, & 5. If users wish to do a system wide install then perhaps they are better off using the PPA for sublime-text-2 by webupd8team [2]. The recommendations here still involve altering /usr which is a system filesystem, and can only be edited using root privileges, and for good reason, they will interfere with updates/upgrades by package-manager. A better solution is to symlink the executable to your ~/bin folder, which is always on your path, and then alter the gnome desktop settings in ~/.local/share/applications/. These AskUbuntu answers [3, 4] provide directions for creating a desktop/launcher icon that doesn’t require root privileges or interfering with Ubuntu’s core system. (Full-disclosure – ref [4] is my post.)


  48. Thank you very much for this! I’d be running it out of my home folder and so Ubuntu didn’t know of it’s existence! This is way better.

  49. Another way to do it is installing Ubuntu Tweaks (which is a must have program for Ubuntu). Program has sections “programs” which acts kinda like Ubuntu Software Center. And among these programs is Sublime Text 2 and also its developer version. 🙂

  50. The file associations don’t work for me. I edited /usr/share/applications/defaults.list as recommended (except that the command is subl rather than sublime) , but when I click on a python file for example, it opens in gedit. Here is the line from /usr/share/applications/defaults.list:


    The word “gedit” appears nowhere in the file. If I type “subl” at the command prompt, sublime opens as you would expect.

    I don’t even know where to look. Have you any suggestions?


    1. I think I know what the problem is. When I put the sublime.desktop file in /usr/share/applications, no icon shows up on my desktop, so I put it in my Desktop directory instead, naming it subl.desktop. Apparently, the files referred to in /usr/share/applications/defaults.list won’t be found in my Desktop directory.

      Have you any idea why the icon doesn’t show up? I do have other .desktop files in my Desktop directory.

  51. Errrr… one thing though: my icon on launchpad opens up to sublime.desktop instead of a new clean window. Any idea on how to make it work? Thanks!

  52. Thanks a lot for this. Though I have an issue, everytime I open sublime it doesnt show me the last files I have opened but still shows the sublime.desktop and defaults.list files.

    Anyone knows how to fix it?

    1. that didn’t work. What I did was to clear all items in ‘open recents’. that way now I have a clean ST every time I click the icon. Though now is another problem, that it doesn’t open the last opened file from the previous time. It is always blank.

  53. Hi mate. Does it works only for the 64bit version? I need to install the 32bit one.

    Anyway I run your code and this is what I get:

    ~$ tar xf Sublime\ Text\ 2.0.1\ x64.tar.bz2

    tar: Sublime Text 2.0.1 x64.tar.bz2: No se puede open: No existe el archivo o el directorio
    tar: Error is not recoverable: exiting now


    Any help? Thanks in advance!

  54. *”No se puede open: No existe el archivo o el directorio” means “Can’t be opened: File or directory doesn’t exist”


    Use instead:
    sudo add-apt-repository ppa:webupd8team/sublime-text-2
    sudo apt-get update
    sudo apt-get install sublime-text

      1. Thanks for this warning and link!
        I had the exact same problem. My session was only being saved when run as sudo, and I wasn’t aware that modifying the /usr directory was inadvisable.

    1. Actually, I think the above comments are right about the correct way to do this, but this is still useful to see the manual steps.

  56. Nice tutorial. One problem, though. If you start sublime the first time with sudo, the ownership in ~/.config will be set to root:root causing all sorts of problems.

    So you might want to add that you have to open sublime atleast once as normal user before using sudo sublime.

  57. Not sure If I need to do step 4 or if I understand step 4. What do you mean by “Create a luancher in Unity”?

    Thanks though, this worked,


  58. Hey,

    I did all the steps you taught and sublime is not appearing in the dash and when I run the command “sublime” sublime text opens but when I close the terminal sublime closes too.

    I am using ubuntu 13.04. How do I reinstall?

  59. Yes it is. However, every now and then it will prompt you to purchase it. Might seem annoying but it is so so worth it cos it is free. Paying for it is giving back to the developer and you might possibly get updates or something. But yea it is free.

  60. Lol, this is really pathetic, all those brainiacs working on linux and they cannot handle simple app installation without terminal and problems. Like typing bunch of command will make me smarter.

    1. Lol who said we were brainiacs? I have heard no such boasting? Who said command line makes anyone smarter. Nub

  61. Hey,

    Thanks for this, but I need help with a problem when following the instructions.
    After installation, the files : “sublime.desktop” and “defaults.list” is left in sublime text editor. Whenever I open sublime these files are always there. How do I prevent that?



  62. Perfect tutorial.

    Just one thing,

    %U in sublime.desktop to have ‘open with sublime’ in files.

    [Desktop Entry]
    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 %U
    Icon=/opt/Sublime Text 2/Icon/48×48/sublime_text.png

    [NewWindow Shortcut Group]
    Name=New Window
    Exec=sublime -n

  63. Hi,

    When I tried the step 4, it gives me an error: sudo: sublime: command not found.
    Is there any fix for that?

  64. Thank you Jevin.

    This is solid. I modified it slightly because I have Sublime Text in ~/Applications, Sublime Text now has a 256×256 icon, and the executable is now called sublime_text. I had to provide a full path in Exec and NewWindow Exec in quotes as “/home/alain_odea/Applications/Sublime Text 2/sublime_text”.

    This took me all of 3 minutes to get working thanks to your post.


  65. This is just what I was looking for, and it worked perfectly! Thanks for the detailed, step-by-step instructions. I’ve got Sublime fully integrated with my Ubuntu 12.04 as a result.

  66. I was wondering, is there any way to detatch the sublime from terminal, after I start it from there? I mean, how can you make the terminal close or show a usual input prompt, after I press the sublime command in the terminal?

      1. p.s. I’m not sure if you can close the terminal after this technique ( I presume sublime would get killed if you close the terminal window since it is a process in that terminal), but you can use the terminal normally after starting sublime (or vim, or some random application) this way

  67. I have Sublime Text installed, but I have to start it with sudo to get my config changes to persist. Is there a way around this?

  68. First, webupd8team’s repository install mono, which is ridiculous, so I don’t use that repo.

    Second, all the “sudo sublime ..” in this tutorial should be replaced with “sudo nano ..” or you won’t be able to install any packages or color schemes or anything.

  69. Thanks for the guide. I have one question though. Whenever I open the program from the dash it always opens sublime.desktop and defaults.list. Is there any way to stop it from opening those every time?




    Use instead:
    sudo add-apt-repository ppa:webupd8team/sublime-text-2
    sudo apt-get update
    sudo apt-get install sublime-text

    1. If you’ve already followed the OP’s instructions, do this:

      sudo apt-get –purge remove sublime-text* (from

      and you may need to do this, as well (from

      sudo chown -R username:username /home/username/.config /sublime-text-2

      Just replace username with your account’s username. This should fix the permission error in the case that you opened up Sublime Text as root when you first entered the license.

  71. just do this,

    sudo add-apt-repository ppa:webupd8team/sublime-text-2
    sudo apt-get update
    sudo apt-get install sublime-text

  72. Hey, Thanks a ton!
    It worked absolutely fine for me..

    Sublime is awesome text editor. Not only for Simple text editing, but it’s just great for the coding purposes.

    I am not going back to gedit again.
    Thank you!

  73. Hello, awesome tutorial but when i am entering my license it disappears when i’m opening the program again. This is frustrating, how do i fix this? And also, when i’m opening Sublime again it shows up a tab with the file “defaults.list”.

    1. Yeah, that’s the problem with the original instructions. Look at Yavuz post from Sept. 30. First, remove the bad install by using the instructions I posted, then install using Yavus’ instructions.

      1. Hi again,

        Thanks, i missed that! I’ve now installed it and it pops out an error for me:

        “Unable to run package setup:

        Traceback (most recent call last):
        File “./”, line 165, in upgrade
        upgradePackage(pkg, pristinedir, datadir, backupdir)
        File “./”, line 158, in upgradePackage
        os.path.join(backupdir, base), inhibitOverwrite)
        File “./”, line 113, in upgradeArchive
        shutil.copy(src, dst)
        File “.\”, line 88, in copy
        File “.\”, line 53, in copyfile
        IOError: [Errno 13] Permission denied: u’/home/cybe/.config/sublime-text-2″

        1. Looks like you might need to run that second command

          “sudo chown -R username:username /home/username/.config /sublime-text-2”


          1. Hi again,

            It worked to launch it now and i had to enter this line also to get it going:

            “sudo chown -R cybe:cybe /home/cybe/.config/sublime-text-2/Pristine\ Packages/Java.sublime-package”

            But the tab is always there still… Is there something else i have to do?

  74. I’ve been searching all over Google on how to add Sublime Text 2 to dashboard. Only your method works like charms. Thank you Jevin!

  75. Thank you guy so much for posting this!! I’m just getting started with c++, and I hear this is one of the best UID’s out there! Thanks again!!

  76. Thanks man. It worked perfectly fine. You just have to work harder. Not every single step this blogger made will be the same with your PC’s. For example, the exec file was sublime_text and I swapped that in place of sublime. That’s why those who used sublime failed to have it work.

  77. Plus rapide :
    $ sudo add-apt-repository ppa:webupd8team/sublime-text-2
    $ sudo apt-get update
    $ sudo apt-get install sublime-text

  78. Pingback: Sublime | SZTR
  79. You could definitely see your skills in the work you write.
    The sector hopes for even more passionate writers such as you who aren’t afraid
    to say how they believe. All the time follow your

Leave a Reply

Your email address will not be published. Required fields are marked *


Please enter the CAPTCHA text