在xshell上执行gedit firefox.desktop出现Could not connect: Connection refused

Unable to init server: Could not connect: Connection refused

(gedit:6374): Gtk-WARNING **: 16:33:16.412: cannot open display: localhost:12.0

这个的原因是xshell没有安装可以打开图形界面的软件,firefox的后缀是desktop,这个的后缀表示是桌面的快捷方式,或者是图标,所以需要安装Xmanager(当然还可以安装其他的图形管理软件,不过我的xshell提示安装的是xshell)。而且xshell会提示你安装这个软件,如下:

还可以参看别的博客:https://blog.csdn.net/lux_veritas/article/details/19244349

还有;https://www.jianshu.com/p/d4566e31a265(这个博客和我的情况是一样的)

当然我们还可以不借助xshell,直接去ubuntu或者centos上操作,即直接去ubuntu或者centos上执行命令:gedit firefox.desktop

这样也不会有上面的这样的错误。但是接着可能会出现一些警告(Set document metadata failed: Setting attribute metadata::gedit-position no),关于这个警告看:https://blog.csdn.net/woainilixuhao/article/details/100977551

发布了120 篇原创文章 · 获赞 24 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/woainilixuhao/article/details/100976175