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.
Custom kernel (Accessory, rare):