I have had this problem on one of our servers for some time now and am still trying to figure out what causes it.
When you go to the ‘Solution Management’ screen of Central Administration and retract a solution (wsp) it seems to retract ok but the status of the solution remains ‘Deployed’. When you try and delete the solution in the GUI you then get an error saying that you must retract the solution first – but it is retracted!
To get round this you can run an stsadm command to physically delete the solution:
STSADM –o deletesolution –name ‘YourSolution.wsp’ –override
The override flag is needed to force the removal of the solution as SharePoint thinks it is still deployed even when it is retracted.
If anyone has any ideas of what the problem with the GUI might be or how I can solve it please let me know.
Hope this helps