How can we install Debian Jessie packages offline from the installation USB

6,946

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.

Share:
6,946

Related videos on Youtube

user75798
Author by

user75798

Updated on September 18, 2022

Comments

  • user75798
    user75798 over 1 year

    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?

  • user75798
    user75798 about 10 years
    USB is on /dev/sde. Thanks, but these did not work: apt-cdrom add -d=/dev/sde apt-cdrom add -d=/dev/sde1. loop-mount failed with error message: mount: can't find /the/path/to/the/iso.
  • kostix
    kostix about 10 years
    @user75798, /dev/sde and /dev/sde1 are not mount points -- these are rather device names. apt-cdrom is only able to read files from (mounted) directories, not off cdrom media directly. And... Did you really try to use the /the/path/to/the/iso name? That was just an illustrative example. I hope you're not kidding.
  • kostix
    kostix about 10 years
    @user75798, in case that wasn't clear from the point #2 which read "Mount your flash drive somewhere." you have to mount your flash drive and then supply the mount point (the name of the directory onto which the filesystem on the appropriate drive's partition has been mounted) to apt-cdrom.