requires uncompressed Packages files on CDs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Fix Released
|
Medium
|
Michael Vogt | ||
Hardy |
Fix Released
|
Undecided
|
Michael Vogt |
Bug Description
Binary package hint: apt
TEST CASE:
1. insert a intrepid alternate CD
2. open a temrinal and type "apt-cdrom add"
3. watch it fail
4. install the new apt from hardy-proposed
5. insert a intrepid alternate CD
6. type apt-cdrom add and verify that it works (its ok that it prints warnings about missing files)
----
When acquiring packages from a networked archive, apt is quite happy for the uncompressed Packages file to be omitted to save space; it only fetches the indexes it needs, and will try Packages.bz2 (if bzip2 is available) or Packages.gz first, so omitting Packages is harmless.
However, the same does not hold for CDs, which is rather unfortunate as the space problem is more acute there; we'd like to be able to remove the uncompressed Packages files from our alternate install CDs and save about 1.5MB. apt-cdrom wants to copy all the indexes, and gets upset when some of them are missing. Here's a demonstration with a hacked-up loop-mounted image from which I removed all the uncompressed Packages files:
$ sudo apt-cdrom -m add
Using CD-ROM mount point /cdrom/
Identifying.. [661daa73dbd974
Scanning disc for index files..
Found 2 package indexes, 0 source indexes, 0 translation indexes and 1 signatures
Found label 'Ubuntu 8.10 _Intrepid Ibex_ - Alpha i386 (20080806.2)'
This disc is called:
'Ubuntu 8.10 _Intrepid Ibex_ - Alpha i386 (20080806.2)'
Copying package lists...gpgv: Signature made Wed 06 Aug 2008 16:39:54 BST using DSA key ID FBB75451
gpgv: Good signature from "Ubuntu CD Image Automatic Signing Key <email address hidden>"
E: Could not open file /cdrom/
E: Unable to determine the file size - fstat (9 Bad file descriptor)
W: Hash mismatch for: main/binary-
E: Could not open file /cdrom/
E: Unable to determine the file size - fstat (9 Bad file descriptor)
W: Hash mismatch for: main/debian-
E: Could not open file /cdrom/
E: Unable to determine the file size - fstat (9 Bad file descriptor)
W: Hash mismatch for: restricted/
E: Could not open file /cdrom/
E: Unable to determine the file size - fstat (9 Bad file descriptor)
I suspect that it might be possible to work around this by removing the uncompressed Packages files from Release, but this would probably cause other problems. Last I checked, the size and checksums of Packages had to be in Release even if the files themselves were missing, in order that apt could verify those files after uncompressing them. People do create local mirrors starting from an Ubuntu CD image quite often, so I wouldn't like to introduce a two-way incompatibility here.
Would it be possible to only fail if none of the versions of a given Packages file are available, or explicitly copy only the compressed files, or synthesise the uncompressed files from the compressed ones in order to verify Release file integrity, or something?
Related branches
Changed in apt: | |
assignee: | nobody → mvo |
status: | New → In Progress |
description: | updated |
I may be slightly naive here (having not looked into the code yet), but can we not have apt-cdrom reuse the apt-get codepath to "unpack Packages.{bz2,gz} to /var/lib/apt" and then use the results for the Release file verification?
One could, of course, make the above conditional on the CD not having uncompressed Packages files, if you want to avoid populating /var/lib/apt and wasting local disk space when the CD *does* have those files.