How to cleanup your GNOME registry?

[img_assist|nid=1030|title=|desc=|link=none|align=left|width=100|height=114]The other day I stumbled upon this neat tool that helps cleanup your GConf registry, called GConf Cleaner. While GNOME registry size isn't nowhere near the size of Windows registry, and thus shouldn't slow your computer too much, it's still nice to have a tool that cleans unused and obsolete entries.

Meet GConf Cleaner

The tool is still in early stages of development (version 0.0.2), but I've successfully run it on my desktop and was amazed how many old entries it found. Typically, if you install some GNOME application, play with it a little bit and later decide to delete it, it's configuration settings will remain in the GConf database. So your registry will only grow in time.

To get the GConf Cleaner source, go to
Download the most recent version you find. Next, unpack it with something like:

tar xf gconf-cleaner-0.0.2.tar.gz

and change to its directory. Building and installing is straightforward:

make install (as root)

If everything is OK, you should now have gconf-cleaner binary installed and ready to run.

The cleanup in detail

When run, gconf-cleaner first introduces itself:


Press 'Forward'.

Next stage is to go through your registry and build up a list of keys to delete. You'll be provided with a nice scrollable list of all entries that gconf-cleaner is about to delete:


You can deselect some of the entries, if you know better. Before next step, it would be opportune to backup your existing GConf database which hides in $HOME/.gconf directory. Do something like

cp -av ~/.gconf ~/.gconf-backup

Remember, this is ALPHA software! If there are bugs in it, it could eat your whole configuration database.

Finally, when you feel brave enough, press 'Forward' once again and in a split second, gconf-cleaner will report that it has deleted the keys it selected in the previous step:


And that's it. You can observe that, on my desktop, it deleted 734 of 3799 keys, which is significant (at the same time, the size of GConf database went down from 458495 to 284657 bytes). From what I can tell, everything is working just fine. Your mileage may vary!

Related info:
GConf: Manageable User Preferences


A registry cleaner for Linux? Who would have thought that?! The user-friendliness of GNOME at its finest.

Seriously, it's beyond me what a unreadable binary-XML configuration blob should be good for at all.

Everything's explained in there. It's actually not binary, but being XML it's not very human readable, either. There's an editor called gconf-editor that allows somewhat better user experience for editing entries, but it's quite easy to get lost even with it.

Also, I noticed that depending on configuration, GNOME version etc... the entries could be spread in many files in .gconf, or contained in only one file named %gconf-tree.xml in the same directory. Anyone to shed some light on that phenomenon?

IIRC the merged XML tree was introduced for better performance (reducing startup time), but i could be wrong...

Hey every distro put it's hands over those XML's file. (except of course Gentoo ) /var/lib/, just go on blame or favourite distributor, IMAHO the ubuntu devs use this heavily, insult them . How on earth do you think all those NoNe-gnome apps got into your desktop at the first place, yeah firefox is not a gnome app. Also thunderbird and a handfull more.

There is no need of editing those files, if you go and remove all the ~/.config the standard result is that your desktop returns to normal, just as KDE, no need for useless crap, so it's pointless editing $/home/.config files, really much better: _delete_ all the crap that ubuntu's ships with on _/var/lib_.

/done no need of WINDOZE CRAAAAAAAAP, no crossed links neither all other stuff that resembles M$


ps. remeber to insult your distro ;<)

Insult my distro?

Ok, so many users are going to familiar with the Windows registry.
We all understand how bloated it can become.
We all know of at least 5 tools that "cleans" a windows registry.

There seems to be two questions here:
1, Is gconf a similar beast to the windows registry?
i.e. is it needed to run gnome and associated apps?
2, Do you need to "clean" it?
i.e Like you would do with a Windows registry.

Regardless of whether KDE/Gentoo/SuSE (insert distro here) uses a registry or not, the question was related to Gnome.

Can anyone give a straight answer?

I think this will resolve whether or not this gnome "gconf/registry/conf/XML/binary/whatever you wanna called it" cleaner is needed.


> There seems to be two questions here:
> 1, Is gconf a similar beast to the windows registry?
> i.e. is it needed to run gnome and associated apps?

In a way similar, but also quite different. It keeps settings, but none of it's keys is mandatory to run applications. Even if you delete it completely (don't try this at home, kids!) everything should run perfectly, but you'll lose your customizations, of course.

> 2, Do you need to "clean" it?
> i.e Like you would do with a Windows registry.

Not at all. It is very small. Currently on my system:

364366 Sep 5 18:13 %gconf-tree.xml

>...Even if you delete it completely (don't try this at home, kids!) ...


Long story... my gconf-tree.xml is gone!
Now There is somthing wrong with dpkg...

Any ideas???????????????????????????????

Well, just had a go.

It looks like it nukes a number of Evolution related keys (custom signature, ldap server settings....). so I was wandering how this tool learn about unused entries...

despite of this It's a nice little tool...


I also noticed that some keys that it deleted probably weren't exactly obsolete. But I decided to let it go and see what happens, anyway.

The beauty is that technically none of the keys are strictly required, they just get recreated again if needed. So you may lose a bit of configuration here and there, but it's not like everything will stop working even if you delete the whole database. IMHO, but haven't tried this last thing personally. :)

OTOH, I see lots of zapping keys survived cleaning, and I deleted zapping long time ago (tvtime is much better, btw). I suppose we shouldn't expect too much from a 0.0.2 release.

And yes, I would also like to learn more about it's algorithms, how it decides something is unused or not, but haven't had time to go through the source, which is probably the only way to research further.

Apparently it nukes all keys not belonging to any schema.

I didn't check the whole code, anyway.

I see lots of XML files under /usr/share/gconf/schemas, so maybe it just cycles through them, and keeps those keys, but deletes all the others.

Still, it's a mystery how lots of zapping keys survived in my database. I don't have zapping.schemas installed.

I would think that after years of Windows Registry bloat that we in the FLOSS community could do it better, no? I mean, seriously, you play with a program and then remove it, should not the uninstall process clean up after it? I have not explored ~/.gconf, but I would *hope* that programs put their configs in either their own files or sub-trees, wholly contained therein. We should know, by now, the value of clean and clear organization. So: Can this cleaner be run command-line and run as a cron job?


Nope. From what I see, this is a purely interactive application. Which is not all that surprising, having in mind that apps like this are inherently dangerous. So, you are given the last chance to decide to keep some entries because you surely know better than some heuristics, however sophisticated.

Speaking of bloat, yes, while I do agree on some level, I would like to emphasize once again that GConf database is really nowhere near the size of the Windows registry. And it's really hard to call it a bloat. Keeping the keys after uninstall could even be called a feature - if you later decide to reinstall the application that left configuration entries in the database, you can continue to work from where you left.

Do KDE apps clean configuration database when you uninstall an application? I really doubt it.

I can not speak to KDE because I am a GNOME user. I have not spent any significant time with KDE. I did try it for a short while as my desktop when I first tried Linux (Mandrake) back in September '04, but I quickly got fed up with the RPM system and gave the (then) brand new Ubuntu a try as the new kid on the Debian block. I have stuck with Ubuntu since. I have thought about giving KDE a run for it's money but never seem to make time for it. XFCE and E17 are interesting to me, though the binary-ness of E17 configs rubs me the wrong way. I guess something in "The Art of Unix Programming" took root in my philosophy toward configuration files. Even so, this was never intended, for my part, to be a generalized desktop environment discussion.

With regard to bloat and left-over cruft, I suppose I am just carrying baggage from my bad experiences with Windows registry. Regarding the "feature" of keeping old configs... I suppose it could be viewed that way, though my personal inclination is to prefer the removal of software to leave the system in it's previous state. However I can see this as a useful interactive tool should you want to re-install an un-installed application *without* it remembering it's old settings in GConf. Truly, I have not studied up on GConf much, though it would probably be a good idea, if just for the ability to tweak GNOME in ways it has no GUI-tweaking functionality for. Any suggestions on a primer for those interested in learning more about the GConf system? Or any tools to play with GConf settings that may be of interest?

Oh, and thanks for the article!


True, lots of us in a way "conservative" users prefer to have something either completely installed or completely uninstalled. :) Very good example of such approach would be me :) always installing development packages when something else pulls for example a library package. And also always doing purge instead of plain remove on every uninstallation (I'm speaking about Debian packaging system here).

gconf-editor is a visual application, but there's also exists a command line tool to manage GConf entries. For this or that reason, I never liked gconftool very much, but you may find it useful.

gconftool-2 - GNOME configuration tool

Each preference in the GConf repository is expressed as a key-value
pair. A GConf preference key is an element in the GConf repository that
corresponds to an application preference. Preference keys typically
have simple values such as strings, integers, or lists of strings and
integers. The default key-value pairs are installed on the system, and
are known as schemas. gconftool-2 is the command-line interface tool
that enables you to set the values of keys, display the values of keys,
and install schemas from schema definition files when you install an
application. The GConf preference keys are stored and managed by the
GConf daemon (gconfd-2). These keys are cached in memory, and saved to
disk in XML format when appropriate.

What is this "configuration database" of which you speak? KDE uses no such thing. Uninstall the app and rm the ~dot directory, and you're finished. Or you can just rm the ~dot directory and run the app if you want to reset to defaults. Seems much cleaner and easier to admin to me, but what do I know? I'm just a silly user.

KDE has the same thing: ~/.kde/share/config.


You don't actually use KDE do you?

kde/share/config is nothing more than a file that stores the default settings of certain apps, and most of the time any problems with it is due to certain distros implementing their own "customizations". So although kde does have such a file, it does not in any way function in the manor that Gconf does.

Here's a perfect - yet simple - example:

In GNOME (as of 2.16), in order to change your splash screen, it was necessary to manually edit gconf to point to the file. In KDE, you just fire up Control Center and select the splash that you desire. That's it. There are about a dozen more situations that require gconf, but are done by a standard, INCLUDED gui program in KDE.

One thing is where your configuration data is, and in what state it is (do you have stale entries - configuration items from applications that you deleted long time ago).

Completely orthogonal topic is how good are the tools that use that data, are all keys editable with user-friendly control center and so on...

Answer these two questions:

- can you find any key that is unnecessary, obsolete, should've been deleted long time ago?

- can you find a key in the database that you can't set via visual tool (control center)?

If you answer with yes to both question, then I don't really see how is KDE different from GNOME. I would be surprised if it was.

Std. disclaimer: I don't use KDE, this is purely theoretical.

GConf editor is not intended as an end user configuration tool. If an option isn't available through the application GUI, either the developer didn't think the option was necessary or the developer hasn't gotten around to adding the option yet. Your gripe has nothing to do with GConf. Your gripe is that the Gnome devs didn't make certain features configurable through the GUI, which is an entirely different (and beaten to death) discussion.

Well, one big, centralized configuration database that is barely readable... I guess I will just stick with KDE.

Surely you should avoid KDE for the same reason (it has ~/.kde/share/config)? :)

It's a shame that articles like this use the word 'registry', which has the effect if implying that Gconf is an imitation of the Windows registry, and subsequently that it suffers from the same problems that the Windows registry does. Oh well.

Originally for Ubuntu Feisty, but probably would work on any Debian derivative:

I don't understand why people keep throwing the word "registry" around. These are XML configuration files, more analogous to dot-files in your home directory. Dot-files are never removed on program uninstallation because that's your personal data.

Think of it like this: imagine a ~/.config directory, and under there are the dot-files for all your programs. All those dot-files share a common syntax; once you learn one, you learn any of them.

gconf-editor, although it looks like the Windows Registry editor, is actually a really nice front-end to your dot-files.

It looks like new and improved configuration system is in works:

dconf is a low-level configuration system.

GSettings is the settings-management interface that makes GObject programmers happy.

Both components are currently under heavy development.

dconf is a simple key-based configuration system. Keys exist in an unstructured database (but it is intended that keys that logically belong together are grouped together).

Since a typical GNOME login consists of thousands of reads and 2 writes, dconf is optimized for reads. Typically, reading a key from dconf involves zero system calls and zero context switches. This is achieved with a simple file format that doubles both as the storage format for data in dconf and as an IPC mechanism between the clients and the server.

Avoiding round trips and context switches is nice in itself, but the real win comes from allowing the IO scheduler in the kernel to do a better job by saturating it with requests coming from all of the applications trying to read their keys (as opposed to a common configuration server serially requesting a single key at a time).

Having all of the keys in a single compact binary format also avoids the intense fragmentation problems currently experienced by the tree-of-directories-of-xml-files approach.

Writes are less optimized -- they traverse the bus and are handled by the server in the ordinary way. Change notification is handled by the server. The reason for having a server at all is that because getting the clients to synchronize on writing would be a nightmare.

The server doesn't even have to be activated until the first write operation is performed.

The server is completely stateless and can come and go as it pleases. The list of change notifications that an individual client is interested in is maintained by the bus daemon (as a dbus signal watch/match list).

Learn more

ty, :) I found this tip mighty useful, also even tho there is a 0.3 version out, it needed gtk+-2.0 to install and I don't know what to install - as with all others - I just looked for a deb file, found a 0.2 deb file tho... :)

Why do people keep it calling registry? It doesn't remind Windows registry at all.

Mike Burns, by that logic, regedit.exe is really a front-end for .ini files. GConf and DConf have a lot more in common with the Windows registry than they do with dotfiles.

The flaw with the Windows registry is that it is illogically structure and bloated with all kind of shit that shouldn't even be configurable. Don't be in such a rush to distance yourself from Microsoft - some of their ideas are actually on the right track - they are just almost always executed poorly.

You appear to know very little about both systems.