2

I performed all the steps to install sublime 2 on my Ubuntu 14.04 as shown in this link... askubuntu.com/questions/172698/how-do-i-install-sublime-text-2-3

but when I try to perform this command

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

it gives me an output

ln: failed to create symbolic link ‘/usr/bin/sublime’: File exists

and when I try to add Sublime Text to the Unity luncher using this command

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

it gives me an output

sudo: sublime: command not found

Please help me soon. Thank you.

  • 2
    The command to start Sublime is subl. To your first error: Maybe you already created a file /usr/bin/sublime, but it isn't executable. – s3lph Oct 11 '14 at 14:52
  • Well thanks for answer. But it didn't help me though. And you are right it isn't executable file. Please guide me. – santa banta Oct 13 '14 at 04:54
  • Make the file executable using sudo chmod +x /usr/bin/sublime Then you should be able to just run sublime to start it. – s3lph Oct 13 '14 at 15:26

2 Answers2

3

use subl command instead of sublime

grogu
  • 31
2

Since /usr/bin/sublime already exists, but there is some issue with it, let's get rid of it first:

sudo rm /usr/bin/sublime

Next, we'll create the symlink again:

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

Finally, we'll clear the path cache just in case:

hash -r

You should now be able to run

sublime filename

or

sudo sublime filename

without issues.

MattDMo
  • 2,125
  • 1
  • 13
  • 18
  • It is working bro....but shell giving me some error like ...........GLib-CRITICAL: Source ID 3212 was not found when attempting to remove it...please help me to find cure for it, thank you. – santa banta Oct 15 '14 at 04:47
  • @santabanta see my answer to a similar question on Stack Overflow for an explanation. Essentially, as long as nothing is crashing, it's no big deal. – MattDMo Oct 15 '14 at 14:49