You can download .deb files and install them from a flash drive. There is a package called apt-zip.
Description: Update a non-networked computer using apt and removable media
These scripts simplify the process of using dselect and apt on a
non-networked Debian box, using removable media like ZIP floppies and
USB keys.
One generates a `fetch' script (supporting backends such as wget and
lftp, in a modular, extensible way) to be run on a host with better
connectivity, check space constraints of your removable media, and
then install the package on your Debian box.
(Ubuntu is based on Debian.)