How to uninstall collective.geo.bundle in Plone 5.1.2

Anybody knows how to complete remove collective.geo.bundle.

I don't know about geo.bundle, but I managed to remove the different parts (I actually don't touch geo.bundle, I install the different parts by installing contentlocations, kml and behaviour). Maybe you will be able to use the following though.

First remove the dexterity geo behaviours added to your dexterity types.
Then patch the following components to add the missing uninstall profiles


nothing fancy, basically it's just reverting the default profile (I did not attempt to do it for metadata.xml since I don't understand yet how it is supposed to work) except for

geo.mapwidget registry.xml:
I added a

<records remove="True"  interface="collective.geo.settings.interfaces.IGeoSettings" />

line but I don't understand why it's necessary.

for geo.settings, I changed the uninstall profile to reverse the order of uninstallation (first IGeoFeatureStyle, then IGeoSettings)

After these fixes I restarted Plone and I was able to uninstall in the Plone UI:
behaviour kml contentlocations

Then under debug:

>>> sm=plone.getSiteManager()
>>> su=sm.utilities
>>> import transaction
>>> from Products.CMFPlone.utils import get_installer
>>> qi=get_installer(plone)
>>> from collective.geo.mapwidget.interfaces import IDefaultMapLayers
>>> qi.uninstall_product('collective.geo.settings')
>>> qi.uninstall_product('collective.geo.mapwidget')
>>> su.unsubscribe(IDefaultMapLayers, IDefaultMapLayers)
>>> transaction.commit()

I uninstalled finallly geographer openlayers colorpicker in the Plone UI

It's then possible to remove all the geo components in the buildout and Plone will start.
The crucial part is the manual unregistering under debug. No idea ATM why this is necessary. I admit it's not logical to uninstall settings before mapwidgets.

I tested installation of a different addon to Plone after having zapped the collective.geo components and it installed fine and seemed functional so I'd hope Plone is good to go.

Needless to say, don't attempt this in prod without testing it first.