无法在“在终端中打开”上执行子进程“dbus-launch”(Ubuntu 22.04LTS)

sss*_*tut 11 nautilus gnome-terminal context-menu

我正在使用 pkexec / xhost 为另一个用户“myOtherUser”打开图形文件资源管理器

\n
    \n
  • 在 Ubuntu 18.04 中,我可以通过鼠标右键单击“打开终端”来打开命令 shell。
  • \n
  • 然而,在新机器上使用 Ubuntu 22.04,当我使用鼠标右键单击上下文菜单“在终端中打开”时,出现以下错误:“无法执行子进程“dbus-launch””
  • \n
\n

脚本:

\n
#!/bin/sh\nxhost +SI:localuser:myOtherUser\npkexec --user myOtherUser env DISPLAY=$DISPLAY nautilus\nxhost -SI:localuser:myOtherUser\n
Run Code Online (Sandbox Code Playgroud)\n

日志输出

\n
localuser:myOtherUser being added to access control list\n\n(org.gnome.Nautilus:3429): dbind-WARNING **: 18:11:36.147: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/bus: Permission denied\n\n(org.gnome.Nautilus:3429): libunity-CRITICAL **: 18:11:36.286: file unity-launcher.c: line 1638: unexpected error: Failed to execute child process \xe2\x80\x9cdbus-launch\xe2\x80\x9d (No such file or directory) (g-exec-error-quark, 8)\n\n(org.gnome.Nautilus:3429): libunity-CRITICAL **: 18:11:36.286: unity_launcher_entry_dbus_impl_construct: assertion 'conn != NULL' failed\n\n(org.gnome.Nautilus:3429): libunity-CRITICAL **: 18:11:36.288: unity-inspector.vala:96: Unable to connect to session bus: Failed to execute child process \xe2\x80\x9cdbus-launch\xe2\x80\x9d (No such file or directory)\n\n(org.gnome.Nautilus:3429): dconf-WARNING **: 18:11:36.409: failed to commit changes to dconf: Failed to execute child process \xe2\x80\x9cdbus-launch\xe2\x80\x9d (No such file or directory)\n\n(org.gnome.Nautilus:3429): dconf-WARNING **: 18:11:36.409: failed to commit changes to dconf: Failed to execute child process \xe2\x80\x9cdbus-launch\xe2\x80\x9d (No such file or directory)\n\n(org.gnome.Nautilus:3429): LIBDBUSMENU-GLIB-WARNING **: 18:11:36.448: Unable to get session bus: Failed to execute child process \xe2\x80\x9cdbus-launch\xe2\x80\x9d (No such file or directory)\n\n** (org.gnome.Nautilus:3429): CRITICAL **: 18:11:36.474: update_dbus_opened_locations: assertion 'dbus_object_path' failed\n\n(org.gnome.Nautilus:3429): dconf-WARNING **: 18:11:36.475: failed to commit changes to dconf: Failed to execute child process \xe2\x80\x9cdbus-launch\xe2\x80\x9d (No such file or directory)\n\n(org.gnome.Nautilus:3429): GLib-GIO-CRITICAL **: 18:11:36.513: g_dbus_proxy_new_sync: assertion 'G_IS_DBUS_CONNECTION (connection)' failed\n\n(org.gnome.Nautilus:3429): GLib-GIO-CRITICAL **: 18:11:36.513: g_dbus_proxy_get_cached_property: assertion 'G_IS_DBUS_PROXY (proxy)' failed\nNautilus-Share-Message: 18:11:36.575: Called "net usershare info" but it failed: Failed to execute child process \xe2\x80\x9cnet\xe2\x80\x9d (No such file or directory)\n\n(org.gnome.Nautilus:3429): dconf-WARNING **: 18:11:40.854: failed to commit changes to dconf: Failed to execute child process \xe2\x80\x9cdbus-launch\xe2\x80\x9d (No such file or directory)\nError constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Failed to execute child process \xe2\x80\x9cdbus-launch\xe2\x80\x9d (No such file or directory)\n
Run Code Online (Sandbox Code Playgroud)\n

我怎样才能解决这个问题?感谢您的帮助!

\n

sss*_*tut 37

安装 dbus-launch (通过sudo apt install dbus-x11)对我有用

注意pkexec --user myOtherUser env DISPLAY=$DISPLAY nautilus我改为sudo --user myOtherUser env DISPLAY=$DISPLAY nautilus