A fairly straightforward way to do this - short of spinning up a VM - is to use a docker image, e.g.:
# use whatever ubuntu version you are targeting, although there may be pkg version differences:
$ docker run -it ubuntu:18.04
# using docker makes things like spin up/copying text/deleting images faster, but keep in mind a few gotchas:
# _may_ have to install wget (if downloading signing keys)
$ apt install wget
# needs gnupg if using apt-key add
# apt install gnupg2
Then, (in the VM or docker image) download the apt packages without installation:
$ apt update
$ apt install --download-only <package>
# results found in:
$ ls -lh /var/cache/apt/archives
After this you can safely transfer the .deb
files in /var/cache/apt/archives/
wherever you need.
(Note, if using docker, there is a docker cp
command to copy files from a container to host).