Sublime Forum

Launch in terminal `subl` don't work

#1

Xubuntu 22.04 LTE
XFCE Terminal 0.8.10
Sublime, Stable Channel, Build 4169

I use Sublime as main code editor and git commit editor.
Usually I could launch Sublime in Terminal command: subl .
But now this command don’t work.
Another programs in terminal launch normal.
And I can use Sublime as git commit editor: git commit .

But launch subl don’t work.

I tried with
sudo ln -s /opt/sublime/sublime_text /usr/bin/subl
and
sudo ln -s /opt/sublime_text/sublime_text /usr/local/bin/subl
it’s don’t work too.

Error:
bash: /cygdrive/c/Program Files/Sublime Text 3/sublime_text.exe: No such file or directory

What can I do?

0 Likes

#2

Looks like you’ve got a symlink somewhere pointing to a path for a Microsoft Windows install of ST. I suggest running which subl to find out where that’s coming from.

0 Likes

#3

I use Linux (Xubuntu 22.04 LTS), NOT Microsoft Windows.

Yesterday command subl worked normal. But now it doesn’t work.

When I type command subl I receive error:

myname@MyName:~/Repositories/Landing_Page$ subl
bash: /cygdrive/c/Program Files/Sublime Text 3/sublime_text.exe: No such file or directory

But when I type git commit - Sublime launch normal as git commit editor.
And. of course, Sublime work normal with graphic interface.

Problem only with command subl

0 Likes

#5

And when I try:
sudo ln -s /opt/sublime_text/sublime_text /usr/local/bin/subl
I receive error:

myname@MyName:~/Repositories/Landing_Page$ sudo ln -s /opt/sublime_text/sublime_text /usr/local/bin/subl
ln: failed to create symbolic link '/usr/local/bin/subl': File exists
0 Likes

#6

I use Linux (Xubuntu 22.04 LTS), NOT Microsoft Windows.

I know, but the path in the error message is for Microsoft Windows. Perhaps that helps you narrow down the issue.

I suggest running:

$ which subl

to find out where that’s coming from.

0 Likes

#8

Type:
$ which subl

myname@MyName:~/Repositories/Landing_Page$ which subl
/snap/bin/subl
0 Likes

#9

Looks like the issue is related to ubuntu snap packages. Did you install Sublime Text using a snap or did you follow the official guide? What’s the result of file /snap/bin/subl?

0 Likes

#10

I installed Sublime using graphical interface Software (from basic programs Xubuntu).
And yesterday command subl worked correct.

0 Likes

#11

oh, when I typed
/snap/bin/subl
terminal launched Sublime

0 Likes

#12

The Sublime Text snap on the ubuntu store is not an official distribution of Sublime Text. I suggest following our documentation for installing Sublime Text on Linux: https://www.sublimetext.com/docs/linux_repositories.html. Otherwise I suggest taking this issue to the authors of the snap package.

1 Like

#13

I installed Sublime from your instruction (for apt - Ubuntu).
But subl don’t work.

0 Likes

#14
myname@MyName:~/Repositories/Landing_Page$ subl
bash: /cygdrive/c/Program Files/Sublime Text 3/sublime_text.exe: No such file or directory
0 Likes

#15

Did you uninstall the snap?

0 Likes

#16
myname@MyName:~/Repositories/Landing_Page$ sudo snap remove sublime-text
sublime-text removed
myname@MyName:~/Repositories/Landing_Page$ subl
bash: /cygdrive/c/Program Files/Sublime Text 3/sublime_text.exe: No such file or directory

After remove snap version don’t work too.

0 Likes

#17

What does which subl output now?

0 Likes

#18

The same error:

myname@MyName:~/Repositories/Landing_Page$ subl
bash: /cygdrive/c/Program Files/Sublime Text 3/sublime_text.exe: No such file or directory
0 Likes

#19

I remove snap version.
It’s error when I use Sublime from your instruction.

0 Likes

#20

What does “which subl” output now?

0 Likes

#21

myname@MyName:~/Repositories/Landing_Page$ which subl
/usr/local/bin/subl

0 Likes

#22

And I tried with
sudo ln -s /opt/sublime/sublime_text /usr/bin/subl
and
sudo ln -s /opt/sublime_text/sublime_text /usr/local/bin/subl
it’s don’t work too.

myname@MyName:~/Repositories/Landing_Page$ sudo ln -s /opt/sublime_text/sublime_text /usr/local/bin/subl
ln: failed to create symbolic link '/usr/local/bin/subl': File exists
myname@MyName:~/Repositories/Landing_Page$ sudo ln -s /opt/sublime/sublime_text /usr/bin/subl
ln: failed to create symbolic link '/usr/bin/subl': File exists
0 Likes