Debark
Get Debark
Browse docs

Why dependencies get missed

An apt download on your online computer can leave out dependencies needed by the offline machine.

ExplanationUpdated

On this page

Running apt-get install --download-only jq downloads what the computer running the command needs. It skips dependencies that are already installed there.

Your offline machine may not have those dependencies. Copying the downloads across can then leave you with an installation that fails.

Use the offline machine’s package list

Debark saves the offline machine’s installed packages and apt settings in a snapshot. On the online computer, it gives that information to apt in a temporary working directory.

apt can then work out what the offline machine is missing. The online computer’s installed packages don’t affect the result.

The same request for jq, resolved on the builder and resolved against the target's own package state.Two resolutions of one request, and why the second is the one that travels. apt answers against the dpkg status of the machine it runs on. The builder already has libonig5 installed, so apt-get install --download-only jq fetches two packages, jq and libjq1, and skips the library the builder is not missing. The bundle looks complete where it was built. The target does not have libonig5, so the install stops with an unmet dependency, on the far side of the gap with no network to fix it from. Debark seeds a throwaway private apt root with the target's own dpkg status and sources, so apt is asked what that machine is missing: the same request resolves to 3 packages, 387.5 kB, with libjq1 and libonig5 pulled in automatically.What goes wrongapt answers for the machine it runs onair gapBuilderlibonig5 already installedapt-get install--download-only jqBundle2 packages fetchedjq, libjq1libonig5 skippedTargetlibonig5 absentinstall failsunmet dependencyThe bundle looks complete where it was built, and is short at the gap.What Debark does insteadapt is handed the target's package stateair gapPrivate apt rootseeded with the target'sdpkg status and sourcesdebark buildBundle3 packages, 387.5 kBjq, libjq1, libonig5what the target is missingTargetlibonig5 absentinstall worksclosure completeapt was asked what the target is missing, so all three packages travel.

In this example, the online computer already has one of the libraries that jq needs. Using the target’s snapshot includes that library in the download.

Check the bundle before transferring it

During a build, Debark also simulates an installation using the finished bundle as the only package source. This checks that apt can satisfy the request without downloading more files.

The check uses the snapshot. If the offline machine changes, take a new snapshot before building its next bundle.