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.

3
  • 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, 2014 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. Oct 13, 2014 at 4: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, 2014 at 15:26

2 Answers 2

3

use subl command instead of sublime

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.

2
  • 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. Oct 15, 2014 at 4: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, 2014 at 14:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .