Remove duplicate site then 'installation failed'


I guess this isn’t a new question but here goes.

If I end up with two versions of the same site in my dashboard – and and then I delete one version I may be then left with plugin icons that are still grey.

If I then try to install that plugin from the dashboard the installation fails because it was installed on the deleted version of the domain in the dashboard.

So the site is there and the plugin is already there.

How do I refresh and sync my dashboard after deleting duplication domains?