Local repo on Debian - hpaluch/hpaluch.github.io GitHub Wiki

Local repository on Debian

How to install all packages from local copy of repository (fully offline).

  • install Debian 12 from DVD - I used: https://ftp.linux.cz/pub/linux/debian-cd/12.0.0/amd64/iso-dvd/debian-12.0.0-amd64-DVD-1.iso

  • create target directory for repository:

    mkdir /INSTALL-DVD
    
  • after installation mount DVD-ROM using mount /media/cdrom command

  • and copy these files (I simply used mc)

    • debian (symlink to .)
    • dists/ - contains just metafiles for each distribution
    • pool/ - contains real packages
  • here is example listing of copied DVD:

    ls -l /INSTALL-DVD/
    
    total 8
    lrwxrwxrwx 1 root root    1 Jun 10 12:27 debian -> .
    dr-xr-xr-x 3 root root 4096 Jun 10 12:27 dists
    dr-xr-xr-x 4 root root 4096 Jun 10 12:28 pool
    
  • now edit /etc/apt/sources.list this way:

    #deb cdrom:[Debian GNU/Linux 12.0.0 _Bookworm_ - Official amd64 DVD Binary-1 with firmware 20230610-10:23]/ bookworm main non-free-firmware
    deb [ trusted=yes ] file:/INSTALL-DVD bookworm main non-free-firmware
    
  • an try as root apt-get update - it should work

  • note: trusted=yes is required (see also https://superuser.com/questions/1331936/how-can-i-get-past-a-repository-is-not-signed-message-when-attempting-to-upgr), because file /INSTALL-DVD/dists/bookworm/Release is not signed for unknown reason...