LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   problems with apt-cdrom add command (https://www.linuxquestions.org/questions/debian-26/problems-with-apt-cdrom-add-command-866761/)

mark_alfred 03-06-2011 09:41 AM

problems with apt-cdrom add command
 
Hello. I recently upgraded to Squeeze from Lenny. I had some problems along the way, though, so it's not a full upgrade. However, I am now running Squeeze.

I have dial-up, so I'm trying to use the eight Squeeze dvds. I was able to add them with "apt-cdrom add" in Lenny, but with Squeeze the dvd-drive was not being read (/dev/hdc became /dev/cdrom1, or /dev/sr0). In the release notes it said that it had to be mounted at /cdrom rather than /media/cdrom0 (see here). I have this (using /dev/sr0) in my /etc/fstab file. However, I get the following result:
Code:

debian:/home/mark# apt-cdrom add
Using CD-ROM mount point /media/apt/
Identifying.. [6ebbc4349ee9f03b1a75af22880835e2-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/apt/'
E: Unable to locate any package files, perhaps this is not a Debian Disc or the wrong architecture?
debian:/home/mark#

Note, I get this feedback even though there isn't a dvd in the drive (as if it's remembering a previous attempt, or something.) I saw an entry at debianhelp, suggesting that the mount point be specified. However, if I try "apt-cdrom -d=/cdrom add" or "apt-cdrom -d=/media/cdrom0 add", I get the same result.

I have gotten it to add the first dvd (of the eight) but not the rest. This was after numerous attempts, and I'm not exactly sure how this happened. However, it locked the dvd in the drive, requiring me to type "eject cdrom" to get it out (something which it does all the time). And "apt-cdrom add" won't work with the rest of the eight dvds.

It is in /etc/fstab:
Code:

debian:/home/mark# mount /cdrom
debian:/home/mark# ls -alF /cdrom
lrwxrwxrwx 1 root root 11 Jul 23  2006 /cdrom -> media/cdrom/
debian:/home/mark# umount /cdrom
debian:/home/mark#

But, regardless, "apt-cdrom add" is not working. Any idea how I can fix this?

Hungry ghost 03-06-2011 09:56 AM

Code:

W: Failed to mount '/dev/sr0' to '/media/apt/'
Looks like, for some reason, the system is trying to mount your cd/dvd drive in /media/apt instead of /media/cdrom0. Did you check that the mount point for the drive is properly set in /etc/fstab? The line for the cd/dvd drive should look something like this:

Code:

/dev/sr0      /media/cdrom0  udf,iso9660 user,noauto    0      0

mark_alfred 03-06-2011 10:53 AM

Hi. Thanks for your response. So, here's the /etc/fstab file:
Code:

#/dev/cdrom1    /media/cdrom0  udf,iso9660 user,noauto 0      0
#/dev/sr0      /cdrom          auto    defaults,noauto,ro      0      0
/dev/sr0        /media/cdrom0  udf,iso9660 user,noauto 0      0
#/dev/cdrom1    /cdrom  auto    defaults,noauto,ro      0      0

I believe I have tried every combination of these entries possible. Anyway, the line "/dev/sr0 /cdrom auto defaults,noauto,ro 0 0" comes from the release notes. However, when I try it without that line (and I've used both /dev/cdrom1 and /dev/sr0 for it), using the line you suggested (see code above), I get the following result:
Code:

debian:/home/mark# apt-cdrom add
Using CD-ROM mount point /cdrom/
Unmounting CD-ROM
Waiting for disc...
Please insert a Disc in the drive and press enter
Mounting CD-ROM...
Identifying.. [ab83f92e407f9208490c1bcc61ef4844-2]
Scanning disc for index files..
Found 0 package indexes, 0 source indexes, 0 translation indexes and 0 signatures
E: Unable to locate any package files, perhaps this is not a Debian Disc or the wrong architecture?
debian:/home/mark# eject cdrom
debian:/home/mark#

Notice too that after doing this that the dvd will not come out of the drive unless I type the command "eject cdrom".

jae 03-08-2011 02:19 PM

So, how did you solve it? It is marked "SOLVED"... or did someone mark it erroneously?

mark_alfred 03-08-2011 04:06 PM

Yeah. I initially could not get "apt-cdrom add" to read the disc. However, after changing my sources.list to just http, and then finishing the dist-upgrade, I was able to get apt-cdrom to read the Debian DVD's files, and add the DVD to the sources. So, the issue I wrote about was solved. However, other issues have since come up, such as only being able to install one package from the DVD sources (see bug 606930).

I don't think Squeeze works well with using the Debian DVDs as a source. I think the only solution for using Debian DVDs as your sources with Squeeze is to file a bug report and wait (though perhaps they work from a fresh install -- mine was an upgrade from Lenny.)

I did discover though that simply having /etc/fstab read "/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0" for the cdrom, and not simultaneously having the line that the release notes for Squeeze suggested (that being "/dev/sr0 /cdrom/ auto defaults,noauto,ro 0 0") did solve the issue I initially posted about. So, that problem is solved.

jae 03-10-2011 07:22 AM

Quote:

Originally Posted by mark_alfred (Post 4283275)
Yeah. I initially could not get "apt-cdrom add" to read the disc. However, after changing my sources.list to just http, ...

Good. I solved mine by adding

Acquire::cdrom::mount "/media/apt/";

to /etc/apt/apt.conf when I realized it did mount it to /media/apt, but had /media/cdrom (or cdrom0) for the Acquire:: option (and /media/apt as Dir::Media::MountPath. Not sure what went how and why here, but it did solve it. I *suspect* it used /media/apt as the mount point (as shown by the CD actually being mounted there) but used the /media/cdrom path to try to access it (as seen from the File not found messages)


All times are GMT -5. The time now is 03:07 PM.