Proper way to remove unused linked Group data-blocks In the outliner i have a local library called "Current File" and a linked library called "//foo.blend". Is this the proper way to remove all unused group-datablock-links from the "//foo.blend"-library?

import bpy

groups = bpy.data.groups
for group in groups:
    if group.library and group.library.filepath == "//foo.blend":
        if group.users == 1 and len(group.users_dupli_group) == 0: # EDIT
            group.user_clear()
            groups.remove(group)  # &lt;- crash warning, don't use this part of the example.
Groups are intentionally not garbage collected, (so they have to be removed manually). Only a few kinds of data-blocks behave this way, Scene's are another example.

As a user, you can select them in the outliner and unlink them, but there is no way to remove single user groups other then to script this as you have done.

For details see the reference manual.