You might want to consider using Docker. You can build an image on your normal machine, export it as a file onto a USB stick, and then transfer it to your air-gapped machine, import it there. Then running it is just docker run --rm my_image
You can do this for a whole bunch of programs in one image, or a separate image for each one.
indeed .appimage are an amazing thing as they do not require any special runtime or installation process !
I guess I will have to do my own .appimage of software that do not provide them
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 !?
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.
Switch to a distro lineage whose package manager builds in the necessary facilities? Someone's already mentioned Nix, and Gentoo has the --fetchonly switch for Portage which will download (but not install) everything required for a specified package including dependencies, so you can copy all of the files to an external drive at once.
I do it manually, but I don't have a lot of dependencies. Download the main package, install it, check the error message for the package it needs, download the new package, install the main package again... For python stuff pip download will also get the dependencies. Maybe you can use the Debian website since it lists the package dependencies and allows you to download from the website the deb files. You can probably automate with a bash script some stuff.