![使用 gksu 时出现 Gtk-WARNING](https://linux22.com/image/960411/%E4%BD%BF%E7%94%A8%20gksu%20%E6%97%B6%E5%87%BA%E7%8E%B0%20Gtk-WARNING.png)
当我使用时,gksu
我会收到 Gtk 警告,例如:
$ gksu gedit /etc/fstab
(gksu:2792): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
(gksu:2792): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
(gksu:2792): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
(gksu:2792): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
当我关闭正在运行的应用程序实例(在此示例中为 gedit)时,我得到:
(gedit:2796): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
(gedit:2796): 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.8R7MBW': No such file or directory
(gedit:2796): Gtk-WARNING **: Attempting to set the permissions of `/root/.local/share/recently-used.xbel', but failed: No such file or directory
我正在使用 Ubuntu 11.10 64 位。我该如何解决这个问题?
答案1
这些或多或少都是无害的。
第一个是关于缺少 GTK 引擎。
对于您的具体错误:
sudo apt-get install gtk2-engines-pixbuf
查找错误的包:
sudo apt-get install apt-file
搜索错误中给出的模块名称,即前缀为 -
lib
和后缀为.so
- 因此在您的示例中pixmap
,您需要搜索libpixmap.so
apt-file find libpixmap.so
这将提供要安装的软件包,例如
gtk2-engines-pixbuf: /usr/lib/i386-linux-gnu/gtk-2.0/2.10.0/engines/libpixmap.so libgtk2.0-0-dbg: /usr/lib/debug/usr/lib/i386-linux-gnu/gtk-2.0/2.10.0/engines/libpixmap.so
第二种情况是因为 root 用户(
/root
目录)没有.local
目录。你可以运行以下命令来创建目录:sudo mkdir -p /root/.local/share