apt update # recursive apt dependencies apt install apt-rdepends # this downloads all deb packages of dnsmasq and dependencies. Filter out debconf-2.0 because dependency is missing apt download $(apt-rdepends dnsmasq|grep -v "^ "|grep --invert-match debconf-2.0)
apt install dpkg-dev dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
apt install genisoimage genisoimage -J -o apt-local.iso ./pkg
-J generates case sensitive filenames, which apt needs2)
rename debian.sources
. add this to sources.list
deb [trusted=yes] file:/mnt/cdrom ./
https://askubuntu.com/a/458754/1977823
More from ubuntu documentation: https://help.ubuntu.com/community/Repositories/Personal