GConf错误:没有D-BUS守护进程运行?!如何重新安装或修复?

Modified on: Thu, 14 Jun 2018 04:08:23 +0800

安装Konquerer并重新启动笔记本电脑后,尝试以终端内的root身份打开,编辑或访问文件时出现以下错误(这对我来说是存在的)。

  

root @ linuxBox:/ home / v2r#gnome-open /home/

  
  

(gnome-open:2686):GConf-WARNING **:客户端无法连接到D-BUS守护程序:
  // bin / dbus-launch异常终止,出现以下错误:未指定协议
  自动启动错误:X11初始化失败。

  
  

GConf错误:没有D-BUS守护程序正在运行

  
  

root @ linuxBox:/ home / v2r#未指定协议
  无法解析参数:无法打开显示:

似乎还没有在/bin//usr/bin/中正确安装dbus
查看截图:

我将如何解决这个问题,并提前谢谢你?!!!


感谢SirCharlo的回答!它根本无法解决问题。请注意,它只发生在root!

  

root @ linuxBox:/ home / v2r#gnome-open /home/

  
  

(gnome-open:5170):GConf-WARNING **:客户端无法连接到D-BUS守护程序:
  无法连接到socket / tmp / dbus-2RdCUjrZ9k:连接被拒绝
  GConf错误:没有运行D-BUS守护程序

  
  

root @ linuxBox:/ home / v2r#未指定协议
  无法解析参数:无法打开显示:

作者:,v2r

最佳答案

SirCharlo的回答对我有用。在ubuntu 12.04(精确穿山甲)上也存在同样的问题。是的,我也使用su(root)。惭愧,羞耻。同样的问题也开始使用emacs。

问题似乎是,当你su时,DBUS_SESSION_BUS_ADDRESS会保留其值
而不是在/root/.dbus/session-bus /

中获取值

来自man dbus-launch的

   ...
   The second common reason for autolaunch is an su to another  user,  and
   display  of  X  applications  running as the second user on the display
   belonging to the first user. Perhaps the ideal fix in this  case  would
   be  to allow the second user to connect to the session bus of the first
   user, just as they can connect to the first user's display.  However, a
   mechanism for that has not been coded.
   ...

使用sudo,suedit,gksu。

或者如果你必须使用su,那么尝试将它添加到你的/root/.bashrc:

sessionfile=`find "${HOME}/.dbus/session-bus/" -maxdepth 1 -type f`
if [ -f "$sessionfile" ] ; then
    if grep -q "^DBUS_SESSION_BUS_ADDRESS=" "${sessionfile}" ; then
        export `grep "^DBUS_SESSION_BUS_ADDRESS=" "${sessionfile}"`
    else
        echo "DBUS_SESSION_BUS_ADDRESS not found in ${sessionfile}"
    fi
else
    echo "no session address file found in ${HOME}/.dbus/session-bus"
fi
作者:,user68606

相关问答

添加新评论