Safeguard
Supply Chain•

What if a dependency vanishes from the registry? Can you still build?

If a package is removed or a registry is down, a lockfile alone will not rebuild your release. Keep a verified copy: a mirror, a cache or vendored source.

Safeguard Security Team
4 min read

If a dependency vanishes from the registry, a lockfile will tell you what you needed but cannot supply it. You can still build if you hold a copy: a mirror, a populated cache or vendored source. Plan this before you need it, and verify copies by checksum.

What a lockfile does and does not do

A lockfile records exact versions and usually integrity hashes. That makes a rebuild predictable when the registry cooperates. It does not store the packages. The reproducible-builds documentation says inputs from the network are volatile, even when they do not seem to be, and recommends two things: ensure integrity using cryptographic checksums, and keep backups, ideally with a fallback location.

That is the whole problem in two sentences. The checksum tells you whether what you got is what you expected. The backup is what lets you get it at all.

Ways a dependency can disappear

  • A maintainer removes a release or the whole package.
  • A registry has an outage during your release window.
  • A package is taken down after a security problem.
  • A project moves hosting and the old URL stops working.
  • A tool you download in a build script is no longer hosted at that address.

Each case blocks a build that was fine yesterday.

Your options

OptionHow it worksCost
Internal mirror or proxyYour registry proxy keeps copies of what you fetchRun and secure one more service
Pre-populated cacheCI cache or artifact store holds downloaded packagesCache expiry and size limits
Vendored sourceCopy lives in your repositoryReview and update burden
Archive on releaseSave the dependency set with every release buildStorage per release

Each option should be paired with verification. Whichever store you use, compare the hashes of what you hold to the hashes in the lockfile. The FreeBSD ports system, which the project cites as a good example, lists source files with cryptographic checksums and keeps copies on a mirror network so a build can fall back when the original site is unreachable.

Steps for a small team

  1. Find out what you fetch. Run a build offline from a clean state and list every failure. The offline build test covers this.
  2. Pick one store. For most small teams, a pull-through proxy or an archive saved at release time is the least work.
  3. Verify. Check hashes on the way in and on the way out.
  4. Test a restore. Once a quarter, rebuild an old release using just your store with the registry blocked.
  5. Decide what to do on removal. If a package you use is pulled for a security reason, you want to know why, not just keep building quietly. Pair the archive with vulnerability monitoring so you hear about advisories.

The security trade

Keeping a copy is good for availability and reproducibility. It is not a reason to stop updating. A copy of a package with a known flaw is still a package with a known flaw, and archived dependencies need the same scanning as live ones.

Where Safeguard fits

Safeguard's SBOM and dependency scanning, plus continuous monitoring of what you ship, covers the flaw side of archived dependencies. Free scan: gold.safeguard.sh/scan.

Quick check

Does a lockfile with hashes protect me from a removed package?

It protects integrity, not availability. You still need a copy.

Is an internal mirror required for a small team?

No. A saved dependency archive per release can be enough, if you test restoring from it.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.