【OK210试用体验】基于Ubuntu的 Gtk-WARNING常见问题汇总 - 在线问答 - 电子技术论坛 - 最好最受欢迎电子论坛!

【OK210试用体验】基于Ubuntu的 Gtk-WARNING常见问题汇总

770781327 ( 楼主 ) 2015-11-28 22:27:52  显示全部楼层
最近一直在为Gtk-WARNING问题头疼,干脆把Ubuntu下的常见Gtk-WARNING问题汇总下
以后在把解决方案一个个列出来

首先是我自己碰到的几个
1
(gedit:4756): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

2
(gedit:4668): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

3
(gedit:4379): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

其次是网上搜集到的
4
修改ubuntu默认启动项出现(gedit:3168): Gtk-WARNING **
(gedit:3168): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

5
(gedit:9778): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.LTBP3V': No such file or directory
解决方式:
直接在终端中输入:sudo mkdir -p /root/.local/share/

6
(gedit:3211): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files

7
sudo gedit  /boot/grub/grub.cfg
(gedit:5943): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: 创建文件“/root/.local/share/recently-used.xbel.FVTZ9V”失败:没有那个文件或目录
解决方式:
sudo mkdir -p /root/.local/share/
分析:
由于ubuntu默认不启用root账户,所以root就从来没登录过,所以就没有/root/.local/share/目录在ubuntu 11.04中运行所以会出错,只要建立这个目录就解决了。

8
sudo gedit
出现以下错误:
        No protocol specified
        (gedit:3062): Gtk-WARNING **: cannot open display: :0.0
解决:
        执行:sudo xhost +
分析:
        当使用su 到另外一个用户运行某个程序,而这个程序又要有图形显示的时候,就有可能有下面提示:
        Invalid MIT-MAGIC-COOKIE-1 key
        (:3825): Gtk-WARNING **: cannot open display: :0.0
        这是因为Xserver默认情况下不允许别的用户的图形程序的图形显示在当前屏幕上. 如果需要别的用户的图形显示在当前屏幕上, 则应以当前登陆的用户, 也就是切换身份前的用户执行如下命令。

9
运行gedit,普通用户下不会出错,但在su到root下会出现如下错误:
        (gedit:6556): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported
        GLib-GIO:ERROR:/build/buildd/glib2.0-2.26.0/gio/gdbusconnection.c:2270:initable_init: assertion failed: (connection->initialization_error == NULL)
解决:
        注意区分su和su-
分析:
su与su -命令的差别:
su   只能切换到管理员用户权限,不使用管理员的登陆脚本和搜索路径
su - 不但能切换到管理员权限而且使用管理员登陆脚本和搜索路径

10
sudo gedit  /boot/grub/grub.cfg

(gedit:5943): gtk-warning **: attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: 创建文件“/root/.local/share/recently-used.xbel.fvtz9v”失败:没有那个文件或目录
(gedit:5943): gtk-warning **: attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: 没有那个文件或目录
解决:
        sudo mkdir -p /root/.local/share/
分析:
由于ubuntu默认不启用root账户,所以root就从来没登录过,所以就没有/root/.local/share/目录在ubuntu 11.04中运行所以会出错,只要建立这个目录就解决了。

11
sudo gedit
出现以下错误:
no protocol specified
(gedit:3062): gtk-warning **: cannot open display: :0.0
解决:
执行:sudo xhost +
分析:
当使用su 到另外一个用户运行某个程序,而这个程序又要有图形显示的时候,就有可能有下面提示:
invalid mit-magic-cookie-1 key
(:3825): gtk-warning **: cannot open display: :0.0

这是因为xserver默认情况下不允许别的用户的图形程序的图形显示在当前屏幕上。
如果需要别的用户的图形显示在当前屏幕上, 则应以当前登陆的用户, 也就是切换身份前的用户执行如下命令。

0个回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则


关闭

站长推荐上一条 /6 下一条

小黑屋|手机版|Archiver|电子发烧友 ( 湘ICP备2023018690号 )

GMT+8, 2024-4-18 08:19 , Processed in 0.568028 second(s), Total 62, Slave 42 queries .

Powered by 电子发烧友网

© 2015 bbs.elecfans.com

微信扫描
快速回复 返回顶部 返回列表