I'm using debian 8 jessie. I don't use a physical CD-drive, there is no
/dev/cdrom. I have DVD-1 and DVD-2 iso files of the operating system. I mounted DVD-1 iso at
/media/cdrom01 and DVD-2 iso at
/media/cdrom02. I used
apt-cdrom add -d /media/cdrom01 to detect DVD-1 and similarly DVD-2 mounted iso files which automatically creates entries in
/etc/apt/sources.list. The entries created look like this.
deb cdrom:[Debian GNU/Linux 8.3.0 _Jessie_ - Official amd64 DVD Binary-2 20160123-19:03]/ jessie contrib main deb cdrom:[Debian GNU/Linux 8.3.0 _Jessie_ - Official amd64 DVD Binary-1 20160123-19:03]/ jessie contrib main
When installing a package available from DVD-1 or DVD-2,
apt-get determines whether the package containing disk/iso is mounted at
/media/cdrom or not, and prompts to insert the disk when it is not mounted. At that point the
apt-get terminal output gives
Media change: please insert the disc labeled 'Debian GNU/Linux 8.3.0 _Jessie_ - Official amd64 DVD Binary-1 20160123-19:03' in the drive '/media/cdrom/' and press enter
dmesg output gives
[22133.506274] ISO 9660 Extensions: Microsoft Joliet Level 3 [22133.506359] ISO 9660 Extensions: RRIP_1991A
The problem here is
apt-get always checks the mountpoint at
/media/cdrom even when I used custom mountpoint when adding entries through
apt-cdrom. With this scenario, I keep symlinking
/media/cdrom01(or cdrom02) to
/media/cdrom. Now the main issue is, Whenever I try to install packages contained in both DVD's , I have to manually switch the symlink.
If I use only DVD-1 iso file, it can be mounted permanently to
/media/cdrom and packages on it can be installed easily.
Ideally, I would like to detect what DVD apt is requesting and have a script that automatically unmounts other iso and mounts the required iso at
/media/cdrom. Is this possible?
I could also make sources.list point to a real different mountpoint like this
deb file:///media/cdrom01 jessie main contrib deb file:///media/cdrom02 jessie main contrib
but doing so will make the packages unauthenticated, and with
http jessie source enabled, it ignores the local packages because it thinks they are unauthenticated.