Sublime Forum

Sublime text 3 won't launch without sudo

#1

I am running on manjaro KDE. I followed the instructions on the official website and successfully installed sublime without any error.
But when I launched it, whether by clicking on the application icon or by typing subl command in the terminal, it just wouldn’t launch.
There was no error. When I clicked on the icon, I could see it was loading. But nothing showed up!
When I used the subl command in the terminal, the result was as if I hit the enter key without any command – no error message and nothing was running.
The only way I could launch sublime is by using the command sudo sub. I’ve checked the permission of every file I could find that were related to sublime text and set their permission to 755, and change the owner of the every file under /opt/sublime_text to myself, but it still wouldn’t run as non-root user.
I searched on the Internet and found some solutions suggesting the installation of libgtk2.0, but there was no such package in manjaro, and I’ve installed the following packages.
Screenshot_20200207_160637
I’ve been working on this issue for days and still couldn’t figure out where the problem is. Please help! Thank you.

—edit—
I found that when I run /opt/sublime_text/sublime_text without sudo, it would still create a process sublime_text.
When I run with sudo, it would create an additional process:


I found the first parameter of the plugin_host process was the pid of the sublime_text process, so I tried the following:

  1. run /opt/sublime_text/sublime_text, and then run plugin_host manually, both without sudo.
  2. run opt/sublime_text/sublime_test without sudo, and run plugin_host manually with sudo.

I got the error message unable to open channels in both attempts.

0 Likes

#2

Running /opt/sublime_text using --multiinstance --debug, possibly under gdb or similar should help diagnose the issue.

0 Likes

#3

Thanks for replying. Unfortunately, I’m new to linux and don’t know much about how to use gdb :((
I did use strace to see what was going on when executing with and without sudo. But I couldn’t find something helpful with my limited knowledge…
I did find something different though, and I’ve edited my post to include my discovery.

0 Likes

#4

Running gdb -ex run --args /opt/sublime_text/sublime_text --multiinstance --debug should provide what’s needed to find the issue. Plugin host runs the plugins, it’s neither required to run Sublime Text nor can it run on its own.

0 Likes

#5

Hi, the same problem occurs to me. I am running sublime text 3 on Ubuntu 19.10.

I can not run sublime successfully without sudo, and I’ve tried installing sublime via apt, snap, Ubuntu software, and directly download the .tar.gz file, but all of them ends up the same situation.
checked the permission as well as owner,

I’ve also set their permission to 755 and change the owner of the every file to myself, but it still wouldn’t run without sudo.

After I run gdb -ex run --args /opt/sublime_text_3/sublime_text --multiinstance --debug, it shows:

Reading symbols from /opt/sublime_text_3/sublime_text...
(No debugging symbols found in /opt/sublime_text_3/sublime_text)
Starting program: /opt/sublime_text_3/sublime_text --multiinstance --debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff56a7700 (LWP 6847)]
[New Thread 0x7ffff4ea6700 (LWP 6848)]
:0                                                                startup, version: 3211 linux x64 channel: stable
:0                                                                executable: /opt/sublime_text_3/sublime_text
:0                                                                working dir: /opt/sublime_text_3
:0                                                                packages path: /home/xxxxxxx/.config/sublime-text-3/Packages
:0                                                                state path: /home/xxxxxxx/.config/sublime-text-3/Local
[New Thread 0x7fffeffff700 (LWP 6849)]
[New Thread 0x7fffef7fe700 (LWP 6850)]
[New Thread 0x7fffeeffd700 (LWP 6851)]
:0                                                                zip path: /opt/sublime_text_3/Packages
:0                                                                zip path: /home/xxxxxxx/.config/sublime-text-3/Installed Packages
:0                                                                ignored_packages: ["Vintage"]
:0                                                                generating syntax summary
:0                                                                generating meta info summary
:0                                                                pre session restore time: 1.22868

(sublime_text:6842): GLib-GObject-WARNING **: 14:46:13.558: cannot register existing type 'GtkIMContext'

(sublime_text:6842): GLib-CRITICAL **: 14:46:13.558: g_once_init_leave: assertion 'result != 0' failed

(sublime_text:6842): GLib-GObject-CRITICAL **: 14:46:13.558: g_type_register_dynamic: assertion 'parent_type > 0' failed

(sublime_text:6842): GLib-GObject-CRITICAL **: 14:46:13.558: g_object_new_with_properties: assertion 'G_TYPE_IS_OBJECT (object_type)' failed
0 Likes

#6

I can run ST3 in 19.10 without any issues, so it seems to be something with your specific setup. Here’s two other cases I’ve found with the same issue for other apps: https://github.com/monero-project/monero-gui/issues/2161, https://stackoverflow.com/questions/31169778/how-to-fix-glib-gobject-warning-cannot-register-existing-type-gchar

0 Likes