I am sure you already know that when you save a site as a template in SharePoint 2010 it creates a new Solution. You can then create new sites based on this template. Cool.
If you create a site by mistake or have finished with a site then you can, of course, delete that site.
However, if you now try to deactivate your site template Solution you will get a rather unfriendly error message. It seems that there is a lingering link between the Solution and the created site – so if the site is deleted then you can do nothing with the Solution (cannot rename or delete without first deactivating it).
My suspicion is that this may be related to service pack 1 and the fact that the deleted site is sitting in the recycle bin. If you restore the deleted site from the recycle bin then you can now deactivate the Solution as usual.
The workaround I am using for this is to deactivate the Solution before I delete any sites that were created from it. I can then reactivate it and all is well.
This problem only relates to the specific Solution that a site was created from. If you have deleted the Solution and replaced it with a newer version using the same name then you can delete older sites which were created from previous versions of the Solution with no problems.
Hope this saves somebody else some puzzling!