Removing/renaming libs

I create my own libs and use the symlink path to use them e.g symlink://path/to/lib. It works great but sometimes I want to rename, delete, merge libraries and when I then rerun a project with the renamed library it sees that a library has disappeared and tries to remove it but it appears to be dependent on finding the library.json with the old name.

Why is this necessary? Are my only options to make a new lib with the name I want and copy the files and then remove the old lib after projects have been rerun?

This is the error I’m getting

Removing unused dependencies…
MissingPackageManifestError: Could not find one of ‘library.json, library.properties, module.json’ manifest files in the package