"Sadly, it's very difficult to avoid these days."
No it isn't. You do what every professional developer with an ounce of competence has been doing for the last 40-odd years and run your own local repositories.
Rule 1) Do not depend on external repositories.
Rule 2) Really, just don't.