12
How install a package/program with all the dependencies tree to an offline devices ?
(programming.dev)
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
If this is for a user programs rather than system components that must be managed by apt, you could use Nix.
By its nature, it keeps track of all dependencies in a queryable format and Nix stores are actually quite portable; you can just
and that will copy that store path aswell as any dependency (including transitive deps) to e.g. a USB drive.
You'd then do the inverse in the target environment to do the opposite:
And then
/nix/store/6gd9yardd6qk9dkgdbmh1vnac0vmkh7d-ripgrep-14.1.1/
aswell as its entire runtime dependency tree would exist in the air-gapped system.Because Nix store paths are hermetic, that's all you need to execute e.g.
/nix/store/6gd9yardd6qk9dkgdbmh1vnac0vmkh7d-ripgrep-14.1.1/bin/rg
.You'd obviously just adjust your
$PATH
accordingly rather than typing all of that out and typically would install this into what Nix refers to as a profile so that you have one path to add to your$PATH
rather than one for each package.I used a single package here but you could build an entire environment of many packages to your liking and it'd be the exact same as far as Nix is concerned; it's all store paths.
You do need
/nix/
to exist and be writeable in the target environment for this to work though.🤩 Woo I didn't know
nix
. It seem a better way to handle package !!!But so if I have already
apt
that handle packages, is it compatible to use both on the same system !?