0

My dconf database ~/.config/dconf/user/ has many entries that are duplicated or triplicated. Some are "normal" single entries.

To display gsettings in GUI I used this one-liner answer. Then I:

  • clicked "Group" heading for secondary sort
  • clicked "Key" heading for primary sort
  • adjusted column width for screenshot friendly size

dconf database duplicates.png

Verify above GUI accuracy from command line:

$ gsettings list-recursively | grep sudoku-difficulty
org.gnome.sudoku print-multiple-sudoku-difficulty 'easy'

$ gsettings list-recursively | grep "plugins.background priority"
org.gnome.settings-daemon.plugins.background priority 97
org.gnome.settings-daemon.plugins.background priority 97

$ gsettings list-recursively | grep print-wrap-mode
org.gnome.gedit.preferences.print print-wrap-mode 'word'
org.gnome.gedit.preferences.print print-wrap-mode 'word'
org.gnome.gedit.preferences.print print-wrap-mode 'word'

NOTE: database is in binary format and not a sequential text file. I imagine the solution would export existing database to text, massage text records and then import to new database.


Files

Some might comment on what files are involved so here is a modified listing of locate command:

$ llocate /.config/dconf
ACCESS      OWNER    GROUP    SIZE   MODIFIED      NAME (updatdb last ran: 2018-11-05 08:00:04)
drwxrwxr-x  rick     rick     4096   Nov  5 06:58  /home/rick/.config/dconf
drwxrwxr-x  rick     rick     4096   Aug 11 19:37  /home/rick/.config/dconf.bak
-rw-rw-r--  rick     rick     27059  Nov  5 06:58  /home/rick/.config/dconf/user
-rw-rw-r--  rick     rick     20446  Aug 11 19:37  /home/rick/.config/dconf.bak/user
drwxrwxr-x  rick     rick     4096   Oct 16 16:47  /mnt/clone/home/rick/.config/dconf
drwxrwxr-x  rick     rick     4096   Aug 11 19:37  /mnt/clone/home/rick/.config/dconf.bak
-rw-r--r--  rick     rick     27270  Oct 16 16:47  /mnt/clone/home/rick/.config/dconf/user
-rw-rw-r--  rick     rick     20446  Aug 11 19:37  /mnt/clone/home/rick/.config/dconf.bak/user
drwx------  UNKNOWN  UNKNOWN  4096   Oct 13 14:08  /mnt/clone/var/lib/gdm3/.config/dconf
drwxrwxr-x  rick     rick     4096   Jul 29 15:40  /mnt/old/home/rick/.config/dconf
-rw-rw-r--  rick     rick     37094  Jul 29 15:40  /mnt/old/home/rick/.config/dconf/user
  • /mnt/clone is a clone of active partition upgraded to 18.04 for testing
  • /mnt/old is a broken version of 16.04 kept around for recovering files
  • /home/rick/.config/dconf/user is the real database in question
  • /home/rick/.config/dconf.bak/user was generated on a new installation

dconf dump and dconf load are not effective

The utility dconf dump doesn't show duplicate entries:

$ dconf dump /org/gnome/settings-daemon/plugins/power/
[/]
idle-dim=false
lid-close-battery-action='nothing'
critical-battery-action='shutdown'
lid-close-ac-action='nothing'

Running dconf dump of single entries to file and import same file using dconf load doesn't get rid of duplicate entries:

$ gsettings list-recursively | grep lid-close-battery
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'nothing'
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'nothing'

$ dconf dump /org/gnome/settings-daemon/plugins/power/ > dconf-lid-battery.txt

$ dconf load /org/gnome/settings-daemon/plugins/power/ < dconf-lid-battery.txt

$ gsettings list-recursively | grep lid-close-battery
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'nothing'
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'nothing'
  • if you remove an entry does that remove both? If not you could create a sorted list for gsettings list-recursively and move the dupes to a 2nd file and use that file to a remove. – Rinzwind Nov 5 '18 at 15:57
  • @Rinzwind I've googled for an hour and still haven't figured out how to delete a gsettings / dconf database entry. Do you have a link to such a function? – WinEunuuchs2Unix Nov 5 '18 at 17:34
  • It is gsettings reset <key-path> ;-) oh and I think I might have found your problem: you probably have 2 schema definitions. – Rinzwind Nov 5 '18 at 18:03
  • @Rinzwind Unfortunately reset simply resets to installation default. It doesn't delete or remove the key-pair. After running for lid-close-battery-action above it changed the key from nothing to suspend. I will search for how I might have 2 or 3 schemas setup though. – WinEunuuchs2Unix Nov 5 '18 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.