我的 dconf/gsettings 安装坏了。如何在不重新安装 Ubuntu 的情况下修复它?

Dmi*_*try 25 gsettings dconf

我在 VirtualBox 中运行 Ubuntu 12.04.1 LTS x64。在一次非常不幸的误点击(重置保存状态而不是加载保存状态)之后,我遇到了一个非常烦人的问题。

几乎所有应用程序(unity、synaptic、gedit 等)都会在启动时打印:

Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
Run Code Online (Sandbox Code Playgroud)

并且所有 GUI 设置都在重新启动后重置。

另一个症状:

$ GSETTINGS_BACKEND=dconf dconf-editor
(dconf-editor:2353): GLib-GIO-WARNING **: Can't find module 'dconf' specified in GSETTINGS_BACKEND
GLib-GIO-Message: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications
Run Code Online (Sandbox Code Playgroud)

/usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so存在。


我尝试过的(并没有帮助):

  • sudo apt-get install -f --reinstall dconf-tools libdconf0 libdconf-dbus-1-0 dconf-service
  • 从来源和构建dconf-0.5make install
  • 创建空的用户配置文件并在那里启动程序

我必须保留当前的 ​​Ubuntu 安装,因此完全重新安装对我来说不是一个选择。

我该如何解决?

aus*_*_ce 34

如果您PATH与像 Anaconda 这样的 Python 环境管理器发生冲突,也会发生这种情况。

确保which gsettings在进入太深之前运行。如果不打印/usr/bin/gsettings,而是像/home/{username}/anaconda3/bin/gsettings你可能有东西.profile/ .bashrc/.zshrc这样的:

export PATH=$HOME/anaconda3/bin:$PATH

将其更改为:
export PATH=$PATH:$HOME/anaconda3/bin

应用程序结尾而不是预先添加到PATH变量将解决您的问题,但请注意,您的系统bin或其他PATH位置中的任何内容都将取代您的anaconda3/bin.

另一种选择是别名/usr/bin/gsettings

alias sys-gsettings=/usr/bin/gsettings
sys-gsettings get org.gnome.todo view
Run Code Online (Sandbox Code Playgroud)

  • 第一部分(运行`which`)是很好的建议。第二部分,不多说了。您通常希望您的环境使用其自己的设置运行。一个更好的,或者至少是替代的解决方案可能是显式运行 `/usr/bin/gsettings` 而不是搞乱 `PATH`。 (7认同)

Dmi*_*try 11

我找到了解决方案。看来我/usr/local/lib/usr/lib/x86_64-linux-gnu/.

我通过检查加载的动态库发现了它libdconfsettings.so

ldd /usr/lib/x86_64-linux-gnu/gio/modules/libdconfsettings.so

...
<  several dynamic libraries from /usr/local/lib >
...
Run Code Online (Sandbox Code Playgroud)

这是因为动态库的搜索路径顺序(在 中定义/etc/ld.so.conf.d/)。订单如下:

  1. /lib/i386-linux-gnu
  2. /usr/lib/i386-linux-gnu
  3. /lib/i686-linux-gnu
  4. /usr/lib/i686-linux-gnu
  5. /usr/本地/lib
  6. /lib/x86_64-linux-gnu
  7. /usr/lib/x86_64-linux-gnu

因此,例如,如果您将自己的内容libc.so放入/usr/local/lib其中,则将libc.so/lib/x86_64-linux-gnu.

修复:

sudo mv /etc/ld.so.conf.d/libc.conf /etc/ld.so.conf.d/xuserlocal.conf
sudo ldconfig
sudo reboot
Run Code Online (Sandbox Code Playgroud)

  • 谢谢,我也遇到了这个问题,因为我尝试为 glib 开发补丁并执行了 `sudo make install`。`sudo make uninstall` 通过删除 `/usr/local/lib/` 中的那些库解决了这个问题 (2认同)
  • Linux Mint 一直回到默认设置,不尊重我所做的任何更改,并仔细检查了“dconf-editor”。原来我已经从源代码构建了 glib,并且我不知道它不会让我改变我的背景或时钟,或其他肉桂设置。快把我逼疯了。返回链接:https://forums.linuxmint.com/viewtopic.php?t=244360&amp;start=20 (2认同)

Fra*_*que 7

首先检查此命令是否返回true

gsettings writable com.canonical.Unity.Launcher favorites
Run Code Online (Sandbox Code Playgroud)

如果没有,请安装后端:

sudo apt-get install dconf-gsettings-backend 
Run Code Online (Sandbox Code Playgroud)

如果这也没有帮助,请使用以下方法重置您的个人资料:

rm -rf ~/.gnome ~/.gnome2 ~/.gconf ~/.gconfd ~/.metacity .config/dconf/*
Run Code Online (Sandbox Code Playgroud)

之后重启。