this post was submitted on 03 Dec 2024
12 points (92.9% liked)

Linux

48461 readers
499 users here now

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.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Hi,

I have an air gaped[^1] device. ( Devuan )

How do you manage to install packages/software on off-line[^1] device ?

I've heard of apt-offline but it seem to bug and I don't know if it's still maintained (last release two years ago)

of course I've tried manually but the dependencies relations are too crazy to do that fully manually

Dependence tree (not complete even) to install for example apt-offline

├── Depends
│   ├── Depends
│   │   ├── Depends
│   │   │   ├── Depends
│   │   │   │   └── python3-dbg_3.9.2-3_amd64.deb
│   │   │   ├── libcurl4-gnutls-dev_7.74.0-1.3+deb11u14_amd64.deb
│   │   │   ├── python3-pycurl-dbg_7.43.0.6-5_amd64.deb
│   │   │   └── python-pycurl-doc_7.43.0.6-5_all.deb
│   │   ├── python3-httplib2_0.18.1-3_all.deb
│   │   └── python3-pycurl_7.43.0.6-5_amd64.deb
│   ├── iso-codes_4.6.0-1_all.deb
│   ├── python3-pysimplesoap_1.16.2-3_all.deb
│   └── python-apt-common_2.2.1_all.deb
├── python3-apt_2.2.1_amd64.deb
└── python3-debianbts_3.1.0_all.deb

Any ideas ?

Thanks.

[^1]: air gaped, off-line
https://en.wikipedia.org/wiki/Air_gap_(networking)

you are viewing a single comment's thread
view the rest of the comments
[–] Atemu@lemmy.ml 3 points 14 hours ago (1 children)

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

nix copy /nix/store/6gd9yardd6qk9dkgdbmh1vnac0vmkh7d-ripgrep-14.1.1/ --to /mnt/USB-drive/

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:

nix copy /nix/store/6gd9yardd6qk9dkgdbmh1vnac0vmkh7d-ripgrep-14.1.1/ --from /mnt/USB-drive/

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.

[–] SpongeB0B@programming.dev 1 points 8 hours ago* (last edited 8 hours ago)

🤩 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 !?

Nix stores all packages in isolation from each other; as a result there are no /bin, /sbin, /lib or /usr directories and all packages are kept in /nix/store instead.