5

Say I have this line in "/etc/fstab":

/iso/apt.iso /mnt/apt iso9660 loop 0 0

And I run these commands as root:

mount --all
apt-cdrom add --no-mount --cdrom /mnt/apt

I expected the disk to be added as APT source, but nothing happens. What's missing?

UPDATE:

I followed this advice and now I'm getting this:

Using CD-ROM mount point /media/cdrom/
Identifying.. [61c5dd7c11a32dc999e655c235cd698e-2]
Scanning disc for index files..
Found 0 package indexes, 0 source indexes, 0 translation indexes and 0 signatures
W: Failed to mount '/dev/sr0' to '/media/cdrom/'
E: Unable to locate any package files, perhaps this is not a Debian Disc or the wrong architecture?

This happens with or without "/etc/apt/apt.conf" changes.

2
  • Did you run mount /mnt/apt before apt-cdrom -m -d=/mnt/apt add? Commented Mar 16, 2011 at 19:13
  • @forcefsck: I used mount --all before the apt-cdrom cmd. Commented Mar 17, 2011 at 10:12

2 Answers 2

6
+50

here's what worked for me:

first, the line in /etc/fstab should look like this:

/iso/apt.iso /mnt/apt iso9660 user,loop 0 0

then, with the mount-point mounted, run apt-cdrom like this:

apt-cdrom -m -d=/mnt/apt add

if apt still asks you to insert the disk, add these lines to apt.conf

Acquire::cdrom::mount "/mnt/apt";
APT::CDROM::NoMount;

I think you should find this will work for you too :)

0
0

Mounting iso image to directory

mkdir /mnt/hp
mount -o loop /root/HPE_ProLiant_Value_Add_Software-10.80-1.iso /mnt/hp

apt-cdrom examines dir contents and generates entries in /etc/apt/sources.list

apt-cdrom --no-auto-detect --no-mount --cdrom /mnt/hp/ add

Entries looks like this

deb cdrom:[HP Management Component Pack 10.80]/ bionic 10.80/non-free
deb cdrom:[HP Management Component Pack 10.80]/ stretch 10.80/non-free
deb cdrom:[HP Management Component Pack 10.80]/ xenial 10.80/non-free

Replace cdrom-stuff in entries with link to mountpoint, also i had to add [trusted=yes] to evade outdated keys issues

deb [trusted=yes] file:/mnt/hp/ bionic 10.80/non-free
deb [trusted=yes] file:/mnt/hp/ stretch 10.80/non-free
deb [trusted=yes] file:/mnt/hp/ xenial 10.80/non-free

Make sure your iso is still mounted when using apt.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.