Install CDs which are not full live filesystems generally have many of the install packages on them. However, apparently apt-get prefers getting them from online, because the install I just initiated a couple hours ago is fetching *everything* from the net, despite the fact that many of the packages are on the CD, and at least some of those are the latest version.
IMHO, if a version of a package exists on a CD, it should use that package, and only download a patch file, if that saves any time. If the version on the CD is the latest, it should certainly not download from the net - doing so wastes ubuntu.com bandwidth and consumes additional time.
Also, it should not be too difficult to do this as a stream (not quite a pipeline, keep reading.)
1. First process checks for packages that are on the CD. Any it finds, it fetches to the local store. Then, whether or not it found it, it outputs the package name to a fetch queue; if there is no process running the fetch queue, it forks one.
2. The second process, running the fetch queue, downloads any packages listed from online if either no package is present in the local store or if there's a newer version online and no patch available. If the package is in the local cache, but there is a patch available, it downloads just the patch file and applies it to the package. (See Linux Journal issue 170 page 38 for how to do binary patches.) When it has completed processing a package, or if it can't contact the ubuntu.com mirror and the package is in the local cache, it outputs the package name to the install queue. If there is no process running the install queue, it forks one.
3. The third process, running the install queue, simply installs packages.
All three stages use flushed input/output for their various queues. I would personally use regular files for each queue, one line per package, and tail -f to read the files. When the process writing the queue file finishes, it appends an end of queue flag to the file. When the process reading the queue file gets that, it either removes the file, or it moves it to an archive location. Alternatively, the files are named appropriately for archival, and if the debug flag's set, we simply compress it.
Tags:
(none)