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

and the 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.

  • If you must have DVD ISOs in use, mount image 1 in cdrom01 and image 2 in cdrom02, tell apt about this (deb file:///media/cdrom01 distro main contrib ), go on with your live. – user79743 Jan 30 '16 at 18:44
  • @BinaryZebra That would make the packages unauthenticated, even though the packages are from genuine source. – Bharat G Feb 4 '16 at 19:03
  • Are not the packages inside the cd-rom already signed? Why would the signature be forgotten? – user79743 Feb 5 '16 at 1:14
  • The packages are from official iso (md5 verified). The issue is apt-get expects the cdrom mountpoint at /media/cdrom. I can add iso mounted at custom path using apt-cdrom but still apt-get requests to mount cd to /media/cdrom when installing packages. It seems any mountpoint other than /media/cdrom makes the packages unauthenticated. So, I want to detect when apt-get requests cd and automate a script that symlinks appropriate mountpoint to /media/cdrom.. Thanks:) – Bharat G Feb 5 '16 at 20:44
  • Please take a look to [Apt-get conf file example](file:///usr/share/doc/apt/examples/configure-index.gz) there are options to define a different mount point for cd-rom. And automatic mounting of cdrom. Also relevant to read this page – user79743 Feb 5 '16 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.