Debian – How to we install Debian Jessie packages offline from the installation USB


If the media used for installation is a USB stick (which has been created using dd, Unetbootin or some other method), how can one add packages from the USB without an Internet connection?

The following Repository is not usable by default after initial installation:

cdrom:[Debian GNU/Linux testing Jessie – Official Snapshot amd64 DVD Binary-1

For some reason, this USB connection doesn't work.

If the .iso image used to create the installation USB is copied into the new Debian Jessie installation, perhaps there is a means of mounting that ISO, using the packages that are already present by default in the Jessie installation?

Best Answer

Try this:

  1. Remove the existing entry for your CDROM disc from /etc/apt/sources.list
  2. Mount your flash drive somewhere.
  3. Do

    apt-cdrom add -d=/mount/point/of/the/flash/drive

If this doesn't work for the flash drive, try dd-ing the .iso file back from the flash drive, loop-mount it (mount -o loop,ro /path/to/the/file.iso /mount/point) and try using apt-cdrom again.

Yet another possible option, if you're about to use this on multiple computers on a LAN, is to use a toop like reprepro to create a Debian repository on a dedicated server, feed it all the packages from your installation media and serve the resulting repository using a web server.

Related Question