Thanks to IsaacKuo, Senior Member, who gave me this idea. It works. See the bottom of this post for final questions and notes. Later, I plan to tag this as solved. How to create a local repository in debian 9.0.0:
1. Create target directory structure.
Code:
su; chmod a+rwx /mnt/;
mkdir -p /mnt/iso/ /mnt/extract/01/ /mnt/extract/02/ /mnt/extract/03/ /mnt/extract/04/ /mnt/extract/05/ /mnt/extract/06/ /mnt/extract/07/ /mnt/extract/08/ /mnt/extract/09/ /mnt/extract/10/ /mnt/extract/11/ /mnt/extract/12/ /mnt/extract/13/ /mnt/extract/14/;
2. Get repository in iso format. I use brasero to copy dvd. Brasero is on dvd1 and is installed by default.
3. Copy repository to target directory.
Code:
cp *.iso /mnt/iso/;
4.
Code:
su; chmod a+rwx /etc/fstab;
copy and paste this into /etc/fstab.
Code:
/mnt/iso/01.iso /mnt/extract/01/ udf,iso9660 loop 0 0
/mnt/iso/02.iso /mnt/extract/02/ udf,iso9660 loop 0 0
/mnt/iso/03.iso /mnt/extract/03/ udf,iso9660 loop 0 0
/mnt/iso/04.iso /mnt/extract/04/ udf,iso9660 loop 0 0
/mnt/iso/05.iso /mnt/extract/05/ udf,iso9660 loop 0 0
/mnt/iso/06.iso /mnt/extract/06/ udf,iso9660 loop 0 0
/mnt/iso/07.iso /mnt/extract/07/ udf,iso9660 loop 0 0
/mnt/iso/08.iso /mnt/extract/08/ udf,iso9660 loop 0 0
/mnt/iso/09.iso /mnt/extract/09/ udf,iso9660 loop 0 0
/mnt/iso/10.iso /mnt/extract/10/ udf,iso9660 loop 0 0
/mnt/iso/11.iso /mnt/extract/11/ udf,iso9660 loop 0 0
/mnt/iso/12.iso /mnt/extract/12/ udf,iso9660 loop 0 0
/mnt/iso/13.iso /mnt/extract/13/ udf,iso9660 loop 0 0
/mnt/iso/14.iso /mnt/extract/14/ udf,iso9660 loop 0 0
5.
Code:
su; chmod a+rw /etc/apt/sources.list;
copy and paste this into /etc/apt/sources.list
Code:
deb file:/mnt/extract/01/ stretch main contrib
deb file:/mnt/extract/02/ stretch main contrib
deb file:/mnt/extract/03/ stretch main contrib
deb file:/mnt/extract/04/ stretch main contrib
deb file:/mnt/extract/05/ stretch main contrib
deb file:/mnt/extract/06/ stretch main contrib
deb file:/mnt/extract/07/ stretch main contrib
deb file:/mnt/extract/08/ stretch main contrib
deb file:/mnt/extract/09/ stretch main contrib
deb file:/mnt/extract/10/ stretch main contrib
deb file:/mnt/extract/11/ stretch main contrib
deb file:/mnt/extract/12/ stretch main contrib
deb file:/mnt/extract/13/ stretch main contrib
deb file:/mnt/extract/14/ stretch main contrib
6. Mount all filesystems mentioned in fstab. As directed in /etc/fstab, extract from /mnt/iso/*.iso into /mnt/extract/*/.
# mount: /dev/loop1 is write-protected, mounting read-only
7. Tell system about new repository.
Code:
su; apt-get update;
warning. Some permissions were changed to liberal.
Questions.
It is strange that extract from iso works, but copy from dvd does not. Explain please?
I said that the mount command extracts. Perhaps a better word is link?
why is apt-update not on dvd1? Is it replaced by something else on debian 9?
Why does my origional method work on debian 8, but not 9?
apt-secure(8) manpage says insecure repositories are strongly discouraged. So offline, how do I make it secure? I hear this can not be done.
to try.
apt-secure(8) manpage says Individual repositories can also be allowed to be insecure via the sources.list(5) option allow-insecure=yes.
Origional suggestion from IsaacKuo, Senior Member.
dd if=/dev/cdrom of=/myimages/deb01.iso
mount -o loop -t iso9660 /myimages/deb01.iso /mnt/deb01
note on boot. It seems this procedure is a one-time setup. It keeps its settings.
note from sources.list. Do not list the raw iso file.
deb file:/mnt/iso/01.iso stretch main contrib
File not found - /mnt/iso/01.iso/dists/stretch/main/binary-amd64/Packages (20: Not a directory)
note from apt-get update.
W: The repository 'file:/mnt/extract/01 stretch Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.