Remove entity type without module uninstall
The argument for entityDefinitionUpdateManager->uninstallEntityType() is an EntityTypeInterface, not a string.

Drupal stores the last known state of an entity type, you can get it like this:

$entity_update_manager = \Drupal::entityDefinitionUpdateManager();
$entity_type = $entity_update_manager-&gt;getEntityType('your_entity_type_id');
$entity_update_manager-&gt;uninstallEntityType($entity_type);


Note that this is using the enitty definitions update manager to get the entity type definition, not the runtime entity type manager.

The field definitions are also read from state and both the entity type and field definitions are purged afterwards.