Debian Jigdo mini-HOWTO DJ-HOWTO Peter Jay Salzman
p@dirac.org
2002-11-8 ver 0.112 2001 Peter Jay Salzman p@dirac.org / www.dirac.org/p. Distributed subject to the GNU General Public License, version 2. 摘要 获取 Debian ISO 映象文件通常是一个痛苦、缓慢而且低效的过程。Jigdo 是一种以容易、快速且非常有效的方式获取 Debian ISO 文件的新工具。这个 HOWTO 文章讲述了为什么要使用 jigdo,一些它如何工作的原理以及如何使用它去获取和更新 Debian ISO 文件。 Jigdo 是一个非常通用的工具,并没有特别地与 Debian ISO 结合在一起。Jigdo 可以用于制作任何提供类似 Debian ISO 文件那样容易、快速和有效的下载方式的 ISO 文件。这个 HOWTO 文章同样会包含这方面的内容,但主要还是集中于下载 Debian ISO 文件。
前言 作者身份和版权 这个文档的版权 (c) 2001 属于Peter Jay Salzman, p@dirac.org. 在GNU Free Documentation License(版本1.1)之下,允许进行拷贝、发布和/或修改,除我在下一段落所列出的规定以外。 我讨厌包含版权声明的HOWTO文章,它是一个“树杀手”。 你可以从http://www.gnu.org/copyleft/fdl.html处读到 GNU FDL 声明。 如果你想从此HOWTO文章创建一个延伸的作品或将其以商业目的发表,请先与我联系。这将给我一个提供给你最新版本的机会。 我将很感激能收到一份拷贝,不管它是你正在做的东西还是 一个菠菜、大蒜、蘑菇、羊乳酪和洋蓟做成的心形比萨。 致谢 首先,我要感谢 jigdo 的作者 Richard Atterer。 任何使用过 Debian PIK(或更差的)来下载整个 Debian ISO 文件的人都知道原因。 然而,我要再次感谢 Richard Atterer。这个 HOWTO 文章源于我写的一些有关使用 jigdo 的主页,Richard花费时间通过 email 给我大量的改正,澄清和回答了有关 jigdo 的问题。在更新这些网页和转化成 HOWTO 文件过程中,他多次阅读了我的作品。他显然是一个不仅关心自己作品,而且关心使用它的人们的开发人员。不幸的是,这种事情在我们生活的繁忙世界中正变得越来越少。谢谢 Richard,继续这项杰出的工作。 我同时要感谢 Conrad WoodElcio MelloMarcelo Ramos, 他们翻译了这篇文章。我对于他们认为我的文章值得他们花费时间和努力感到光荣。谢谢你们! 评论和改正 我非常关注使用这个文档的人们。即使是 mini-HOWTOs 也要花长时间去写,并且我不会在人们不感兴趣的东西上投入如此多的精力。如果你对此有评论,改正和建议,甚至关于写作风格的话,请不要犹疑,马上写信给我。只要我还没有我的博士学位所淹没,我将尽力回答所收到的关于这一 mini-HOWTO 的每一封来信。 最新版本和译文 Conrad Wood cnw@conradwood.net 将此文章翻译成德语。 Elcio Mello mello@ajato.com.br 将此文章翻译成葡萄牙语。 Marcelo Ramos mello@ajato.com.br 将此文章翻译成西班牙语。 这些译文放在 http://www.dirac.org/linux/debian/jigdo上。请看 稳定的英语版本可以从 The Linux Documentation Project: http://tldp.org/docs.html 的mini-HOWTO 部分找到。如果你想看正在工作的版本,请从 http://www.dirac.org/linux/debian 处获取。如果你想将这个 mini-HOWTO 翻译成其它语言,请与我 p@dirac.org联系。 为什么选择 jigdo ? 如何获取 Debian ISO 映象集? 如果你想拥有自己的 Debian CD,有很多种方法可以得到它们。一种方法是从销售 Debian CD 的供货商 那里购买,这种方法因有些供应商捐款给 Debian 项目而显得有点价值。你的捐献帮助 Debian 得以长时间存在。 另一种得到一套 Debian CD 的方法是自己炼录,这样必须首先获得一个 ISO 映象文件,然后将这个 ISO 映象文件炼录到一个空白的CD上。在有 jigdo 之前,有两种方法可以创建 Debian CD: 下载完整的ISO文件 使用PIK(pseudo-image)工具 这篇文章是关于使用一种工具jidgo,以一种新的更好的方式获取Debian ISO映象文件。事实上,PIK已经过时了,新的规范的获取Debian ISO映象文件的方法是采用jigdo。 为什么不下载整个ISO映象文件呢? 有一些镜像站点提供 Debian ISO 文件的 HTTP 和 FTP 下载。问题是镜像站点太少,并且它们的带宽不足以支持每个想要 Debian ISO 文件的人。例如,fsn.hu 的提供者报告联接饱合,每个月输出的流量达到几个TB! 另外,Debian 的测试版本和不稳定版本经常更新,你的 ISO 文件可能在你下载的当天就变得过时了,除非你找到象将 ISO 文件安装到一个 look-back 设备上,并采用 rsync(那是 PIK 所做的)进行更新。所以当你需要最新的 ISO 映象文件时,你必须每天下载新的 ISO 文件集。显然,这不是你想要的获取 Debian ISO 文件的方法! 即使你想要下载稳定的 ISO 映像文件,它们仍旧每几个月进行更新。下载 ISO 文件会在几个月中给你最新的映像,但每次 Debian 稳定版本的修订版本发布,你又将经历下载整个 ISO 文件集的痛苦历程。这对于你的时间和镜像站点不是很好的利用。 为什么不使用 Pseudo Image Kit(PIK)? PIK 解决了下载整个 ISO 映像文件的问题。快速的下载速度,和 PIK 使用 rsync 来更新 ISO 映像中只需要更新的部分,所以它是一种有效地保持最新 ISO 文件的方法。然而 PIK 仍存在一些严重的问题: PKI 难于使用并且不是很用户友好(user friendly) 不能使用 PIK 下载测试版本和不稳定版本的 ISO 文件集。 PIK 所依赖的 rsync 将占用服务器较多的 CPU 资源。当很多用户在同一台服务器上使用 PIK 时,服务器资源将被耗尽。即使 PIK 被做得对用户更友好一些,对于镜像站点来说仍是不可接受的不友好。 PIK 所使用的 rsync,被许多严格的防火墙所阻隔。所以想使用公司快速的网络工作,使用 PIK 时将会碰到问题。 每一个映像都要存放在服务器上,这在老 Potato 的日子里是可以的,28个 CD 映像“只”需要17GB。从 Woody 开始,96个 CD 大约需要57GB。现在想象还想提供 DVD 映像,这个数字还将翻倍。 什么是 Jigdo? Jigdo(代表着“Jigsaw Download”),为Richard Atterer 所写并且发布于 GNU GPL 条款之下。它是一个进行有效下载和更新 ISO 映像的工具。任何 ISO 映像。Jigdo 不是 Debian 所特有的,然而 Debian 选择它作为下载 ISO 映像的指定方法。Jigdo 工具包含两个工具:jigdo-file 为下载准备一个 ISO 映像,而 jigdo-lite 用于下载 jigdo-file 所准备的 ISO 映像。 jigdo 带有两个工具: jigdo-file 由提供 ISO 映像的人使用,它通过为映像文件创建 .jigdo 文件和 .template 文件使别人可以下载它。 jigdo-lite 由想下载映像文件的人使用。它使用 jigdo-file 所生成的 映像文件的 .jigdo 和 .template 文件来下载该映像。如果你所关心的是简单地下载 Debian 映像的话,你只需要使用 jigdo-lite。 通常的误解是 jigdo 创建 ISO 映像。jigdo 并不创建 ISO 映像文件。jigdo-file 通过创建 .jigdo 和 .template 文件来让人们下载 ISO 映像。想要下载 ISO 映像的人将取得这两个文件并使用 jigdo-lite 去下载该映像文件。ISO 映像文件必须在 使用 jigdo-file 之前创建好,这通常由象 mkisofs 或 debian-cd 的工具来完成。 Jigdo 解决了另两种获取Debian ISO映像的方法所存在的所有问题: 它比下载整个 ISO 映像 快得多。 不象下载整个 ISO 映像,它可以使一个过时的 CD 映像(或者一个 loop 方式安装的过时的 ISO 映像)下载那些自从创建这个 CD(或 ISO 映像)改动过的文件并创建一个更新过的 ISO 映像。与你使用 cvs 更新源代码非常相似。 jigdo-lite比PIK更容易使用。 jigdo-lite 使用 wget,wget 默认使用 http 进行文件传输。PIK 使用 rsync。rsync 可能会被某些防火墙所阻隔,而只有那些阻隔 http 的防火墙你是无法让 jigdo 与它们一起工作的。你几乎将永远不会在使用 jigdo-lite 时碰到防火墙的问题。 jigdo-lite 比 PIK 更加用户友好(user friendly)。 jigdo-lite 比 PIK 更加服务器友好(server friendly)。 显然,jigdo是获取Debian ISO映像的最佳方法。 Jigdo 如何工作(可选的) 你使用 jigdo 时不必了解这篇材料,但是它有助于揭开 jigdo 的秘密。如果你对这些细节不感兴趣,只需往前跳至,“如何使用 Jigdo”。 jigdo拥有两个组成部分: jigdo-file:为下载准备 ISO 文件(由提供 ISO 文件的人使用) jigdo-lite:下载 ISO 文件(由下载 ISO 文件的人使用) 为下载准备 ISO 映像文件 CD 映像是一个叫 iso9660 的文件系统,但在这个讨论中,我们所谈及的 CD 映像是一个称之为“ISO 映像”(大约650MB)的大文件,它包含了处于不同偏移量的文件。 如果一个 CD 包含一个567字节的 README 文件,ISO 映像文件可能包含 README 文件的内容在偏移量20480000到20480567,你可以想象一个 CD 映像为: -------------------------------------------------------- ISO Image: |xxxx| file-0 |xx| file-1 |xxx| file-2 |x| file-3 |xxxx| -------------------------------------------------------- 图形中的“x”区域包含了诸如目录信息,补零,磁盘名字,引导块等东西。 jigdo-file 使用两个东西作为输入:一个完全的 CD 映像(所以 ISO 文件需要预先建好)和一些可能存在或可能不存在映像中的文件的集合。这是一个jigdo-file输入的图形: -------------------------------------------------------- ISO Image: |xxxx| file-0 |xx| file-1 |xxx| file-2 |x| file-3 |xxxx| -------------------------------------------------------- ---------- ---------- ---------- ---------- Loose Files: | file-0 | | file-1 | | file-3 | | file-4 | ---------- ---------- ---------- ---------- 通过魔法,jigdo-file 找出 loose 文件中那些文件属于 ISO 映像以及它们在 ISO 文件中的偏移量。它输出两个文件:一个“.template”文件和一个“.jigdo”文件。 .template 文件 给 jigdo-file 提供一个 ISO 映像和一些可能在或可能不在 ISO 映像中的文件作输入后,它为那个 ISO 映像文件输出了一个 .template 文件。这个文件看起来像下面的样子: -------------------------------------------------------- .template: |xxxx| md5-0 |xx| md5-1 |xxx|cccccccc|x| md5-3 |xxxx| -------------------------------------------------------- jigdo-file 发现 file-0file-1file-3 包含在ISO映像之中,它移去这些文件的内容代之以各个文件的md5校验和(md5-0md5-1 等等 )。 ISO 映像中的"x"数据(目录信息、补零等等东西)被压缩后写入了.template 文件,最后,那些在 ISO 映像中的文件,如果没有象 file-2 一样提供 loose file ,也被压缩后写进.template 文件。这在.template文件的图形中以"c"的形式表现。 提供给jigdo-file,但在ISO映像中没有找到相对应文件的loose file(如file-4)则被忽略。 .jigdo 文件 给 jigdo-file 提供一个 ISO 映像和一些可能在或可能不在 ISO 映像中的文件作输入后,它为那个 ISO 映像文件输出了一个 .jigdo 文件。它是一个 GZIP 格式的文件,因此你必须使用 zcat 或 zless 查看。.jigdo 文件用 gunzip 打开后看起来象下面: md5-0=http://somemirror.org/file-0 md5-1=http://somemirror.org/file-1 md5-2=http://somemirror.org/file-2 md5-3=http://somemirror.org/file-3 .jigdo 文件简单地在 ISO 映像中的文件和该文件的下载 URL 间提供了一种对应关系。.jigdo 文件中还有其它的东西。当你看过整个文件时,你会发觉 .jigdo 文件与 .ini 文件有着相同的格式。它应该是可以自我说明的,但如果你要详细的资料,请看 jigdo 的文档。 上面的显示的格式并不完全与你看到的典型的 .jigdo 文件相同,但已经非常相似。如果你看到 .jigdo 文件尾部的 [Servers] 节,就将看到上面所提供的 .jigdo 文件与实际的 .jigdo 文件的差异了。 下载映像文件 一旦你使用 jigdo-file 为下载准备好了ISO文件,任何人都可以用 jigdo-lite 下载 ISO 文件。jigdo-lite 使用 wget 下载 Debian ISO 文件中的所有文件,并将它们重新组装形成一个 ISO 文件。 下载你的第一个映像(5个容易的步骤) 我们假设你正从头开始,手中没有任何 Debian 的 ISO 文件。一旦你生成自己的 ISO 文件集,以后就可以通过 jigdo-lite 更新它们。我们将在下一节谈谈如何更新你的 ISO 文件。 安装 Jigdo 首先安装 jigdo-file 包: # apt-get install jigdo-file Jigdo 仍处于继续开发之中。错误修正和改进是正常的, 所以当你正在使用 stable 或 testing 版本(应该是指 Debian 的版本)时,请从http://packages.debian.org/unstable/utils/jigdo-file.html处下载基于 unstable 版本的 jigdo-file。直到2002年7月19日它的版本号是0.6.8-1。这是本文的例子所用的版本。 Woody 的用户请注意:Woody(rev 0)所带的 jigdo-lite 不能下载 Sarge 或 Sid。请看 下载 .template 和 .jigdo 文件 对于每个想下载的 ISO 映像,你将需要两个文件: 你想下载的映像文件对应的 .jigdo 文件。 你想下载的映像文件对应的 .template 文件。 例如:Woody 一共有8个映像文件,因此你需要下载8个 .jigdo 文件和8个 .template 文件。它们可以从http://www.debian.org/CD/jigdo-cd/处下载,名字为woody-i386-1.iso.jigdowoody-i386-1.iso.template,...,和 woody-i386-8.iso.template 你也可以选择给 jigdo-file 一个指向所需的 .jigdo 文件的 URL 来代替下载每一个 ISO 映像的 .jigdo 和 .template 文件,如http://a.mirror/woody-i386-1.jigdo。jigdo-lite 会马上下载相关的 .jigdo 和 .template 文件。然而,如果你对第一次使用 jigdo-lite 感到有点紧张,就下载这些文件。我将带你完成整个过程。 运行 jigdo-lite 以你想下载的映像的.jigdo文件为参数运行jigdo-lite。 以Woody为例: $ jigdo-lite woody-i386-1.iso.jigdo 另外,如果你想使用 .jigdo 文件的 URL,而不是 .jigdo 文件在硬盘上的拷贝。则使用这个 URL 作为参数运行 jigdo-lite: $ jigdo-lite http://a.mirror/woody-i386-1.jigdo 你将看到如下的一些东西: ----------------------------------------------------------------- Jigsaw Download "lite" Copyright 2001-2002 by Richard Atterer <jigdo@atterer.net> Getting mirror information from /etc/apt/sources.list ----------------------------------------------------------------- Images offered by `woody-i386-1.iso.jigdo': 1: woody-i386-1.iso ----------------------------------------------------------------- If you already have a previous version of the CD you are downloading, jigdo can re-use files on the old CD that are also present on the new image, and you do not need to download them again. Mount the old CD ROM and enter the path it is mounted under (e.g. `/mnt/cdrom'). Alternatively, just press enter if you want to start the download of any remaining files. Files to scan: 如果你忘了将一个.jigdo文件作为参数传给jigdo-lite,它将会提示你输入一个。 如果你用Ctrl-z挂起jigdo-lite(别这样干,我将告诉你会看到些什么)并 ls 一下,你会发现目录中有一个名为 woody-i386-1.iso.jigdo.unpacked 的文件。这是 .jigdo 文件解压缩后的版本。 现在,jigdo-lite 正在告诉我们如果有一个过时的 CD 版本的话,给出那个 CD 的路径名。开始我们已假设你是从头开始并且没有任何 Debian 的 ISO 映像,所以我们不用进行扫描(我们将在中详细讨论这个问题)。现在只需按<ENTER>。 指定一个镜像站点 你将会看到: ----------------------------------------------------------------- The jigdo file refers to files stored on Debian mirrors. Please choose a Debian mirror as follows: Either enter a complete URL pointing to a mirror (in the form `ftp://ftp.debian.org/debian/'), or enter any regular expression for searching through the list of mirrors (try a two-letter country code such as `de', or a country name like `United States', or a server name like `sunsite'): Debian mirror [http://linux.csua.berkeley.edu/debian//]: jigdo-lite 足够聪明以至能从/etc/apt/sources.list 中将你用来更新 Debian 的镜像站点拉出来使用(你能看到我是使用 linux.csua.berkeley.edu 来作更新的)。如果由于某些原因想使用不同的镜像站点,只需在这里指定这个镜像站点。如果这正是你想使用的镜像站点,按<ENTER>键,jigdo-file 将会在你的主目录中创建一个 .jigdo-lite 文件。 接着,如果你正在使用的.jigdo文件引用的一个包需要从一个Non-US的服务器上下载(软件受美国出口限制阻碍),jigdo-lite会提示你需要一个Non-US服务器。这一消息的显示(和你的回答)与前面段落中描述的镜像对话框非常相似,仅有的区别是你需要指定(或接受默认值)一个Non-US服务器。如果你正要下载的ISO镜像包含Non-US软件,你将会看到: ----------------------------------------------------------------- The jigdo file also refers to the Non-US section of the Debian archive. Please repeat the mirror selection for Non-US. Do not simply copy the URL you entered above; this does not work because the path on the servers differs! Debian non-US mirror [http://linux.csua.berkeley.edu/debian-non-US//]: 并且jigdo-lite会将你的选择写到 $HOME/.jigdo-lite 文件中。然而,如果你要下载的映像文件不包含Non-US软件的话,你将不会看到这个对话框。 注意,你可以改变 $HOME/.jigdo-lite 文件中如下面的行来改变以后下载的默认的镜像站点: debianMirror='http://some-mirror-to-use/debian/' nonusMirror='http://some-other-mirror/debian-non-US/' ISO 文件的下载过程 当指定镜像站点后,jigdo-lite 将寻找 .template 文件。如果没有找到,它将从镜像站点上下载一个 .template 文件。当它找到 .template 文件(或下载一个)后,你将看到: ----------------------------------------------------------------- Merging parts from `file:' URIs, if any... Found 0 of the 1224 files required by the template Will not create image or temporary file - try again with different input files --13:38:08-- http://linux.csua.berkeley.edu/debian/pool/main/b/bind9/ lwresd_9.2.1-2.woody.1_i386.deb => `lwresd_9.2.1-2.woody.1_i386.deb' Resolving linux.csua.berkeley.edu... done. Connecting to linux.csua.berkeley.edu[128.32.247.238]:80... connected. HTTP request sent, awaiting response... 200 OK Length: 157,318 [application/x-debian-package] 30% [==========> ] 47,418 113.22K/s ETA 00:00 ... 当 .template 文件被找到(或被下载)后,jigdo-lite 开始将软件包拉到你的硬盘上。这时将有大量的信息从你的屏幕上闪过,如果这使你感到糊涂,请看。 当 jigdo-lite 正在下载这些包时,切换到另外一个控制台(或打开另一个 xterm )并对 jigdo-lite 所在的目录做一次 ls,现在这个目录应该有6个文件: jigdo-file-cache.db tmp/ woody-i386-1.iso.jigdo woody-i386-1.iso.jigdo.unpacked woody-i386-1.iso.list woody-i386-1.iso.template woody-i386-1.iso.tmp woody-i386-1.iso.tmp 不会马上就出现,它是 ISO 文件的临时版本,只是在写 ISO 文件时才出现。 jigdo-file-cache.db 是一个 Berekeley DB 文件,它包含了当你在Files to scan: 提示时指定目录后读入的任何文件的 MD5 校验和。更全面的描述在. tmp/ 是容纳下载的Debian包的目录。例如,当我在写这个的时候,它包括了: $ ls tmp/ alsa-headers-0.5_0.5.12a-2_all.deb tkdiff_3.08-3_all.deb alsa-utils-0.4_0.4.1-9.1_i386.deb xfonts-intl-chinese-big_1.2-2.1_all.deb gnuserv_3.12.4-3_i386.deb xmanpages-ja_4.1.0.20011224-1_all.deb pilot-link_0.9.5.0-8_i386.deb xscreensaver_3.34-3_i386.deb smpeg-plaympeg_0.4.4-8_i386.deb 这个目录中的文件时不时被写进 woody-i386-1.iso.tmp 并且目录被清空。 此时,去玩一会Quake III游戏,因为整个过程需要一些时间(你可能想到另一台机器上玩游戏,因为当jigdo在装配ISO文件是非常消耗磁盘的)。过些时间,下载将结束,你将会看到: FINISHED --13:32:58-- Downloaded: 7,469,872 bytes in 9 files Found 9 of the 9 files required by the template Successfully created `woody-i386-3.raw' ----------------------------------------------------------------- Finished! The fact that you got this far is a strong indication that `woody-i386-3.raw' was generated correctly. I will perform an additional, final check, which you can interrupt safely with Ctrl-C if you do not want to wait. OK: Checksums match, image is good! $ 更新你的映像文件 大概,你已经阅读了最后一节,根据指引将新创建的 ISO 文件烧录到 CD 上并感觉到有点兴奋。迟早,有些包将被更新,或你要将你的旧 CD 在当地LUG的 installfest 上捐赠给新手们,并给自己烧录一套最新的CD。 由于你已经上手并正在逐渐成为 jigdo 高手,我们不会讲得象前面的部分一样详细。 第一步是下载所要更新映像的 .jigdo 文件和 .template 文件。 你可能会想知道为什么要第二次下载它们,原因你要下载得最新的映像已经发生变化。文件可能被加入和删除,即使没有,任何更新过的包或文件的校验和都与你最开始下载映像所用的 .jigdo 文件和 .template 文件所列的校验和不同。 在这里,你手里可能拿着一个过时的 Debian CD 或者在你的硬盘上有那个过时 CD 的 ISO 映像。让我们逐步进行来获得一个更新的 ISO 文件。如果你有一个 CD,将它放入你的光驱并安装它: $ mount /cdrom 另一方面,如果你有一个想进行更新的 ISO 文件,把它以 loop 方式安装(你可能需要成为 root 以完成这个工作)。由于注意到 Woody 刚得到了一些安全方面的更新,我将更新我的 Woody 映像: # mount -o loop woody-i386-1.iso /mnt 现在将.jigdo文件作为参数运行jigdo-lite。 $ jigdo-lite woody-i386-1.jigdo ----------------------------------------------------------------- Jigsaw Download "lite" Copyright 2001-2002 by Richard Atterer <jigdo@atterer.net> Loading settings from `/home/p/.jigdo-lite' ----------------------------------------------------------------- Images offered by `woody-i386-1.jigdo': 1: Debian GNU/Linux 3.0 r0 Woody - Official i386 Binary-1 CD (debian-30r0-i386-binary-1.iso) Further information about `debian-30r0-i386-binary-1.iso': Generated on Thu, 18 Jul 2002 14:34:12 +0100 ----------------------------------------------------------------- If you already have a previous version of the CD you are downloading, jigdo can re-use files on the old CD that are also present on the new image, and you do not need to download them again. Mount the old CD ROM and enter the path it is mounted under (e.g. `/mnt/cdrom'). Alternatively, just press enter if you want to start the download of any remaining files. You can also enter a single digit from the list below to select the respective entry for scanning: 1: /mnt Files to scan: jigdo-lite 正在请求我们给出已安装的 CD(如果你正在更新一个 CD)或以 loop 方式安装的 ISO 文件(如果你正使用 ISO 文件)的位置。 我将 ISO 文件以 loop 方式安装在 /mnt 上使用,所以我输入 /mnt。 如果你正在更新CD,就输入CD所安装的目录,大多数情况下是 /cdrom。 在任一情况下,jigdo-lite 会扫描安装介质的目录,决定那些文件需要更新和重新使用不需要更新的文件。你将看到类似下面的东西: Files to scan: /mnt/other Not downloading .template file - `woody-i386-1.template' already present jigdo-file: Output file `debian-30r0-i386-binary-1.iso' already exists - delete it or use --force jigdo-file failed with code 3 - aborting. 发生了什么事情?事实上,我想让你看看这个,因为你迟早会碰到它。我正在更新一个 ISO 文件,但那个过时的映像文件正在我工作的目录下。 jjigdo-lite想生成一个叫 woody-i386-1.iso 的文件,但当前的目录下已有一个同名的文件存在(那个过时的映像)。 jigdo-lite 不想毁坏那个文件,所以它提示我们可以删除那个文件或使用 --force选项去覆盖它。 你也可以将其改名或移走它,但我猜想 jigdo-lite 假设我们已知道这些。?:-) 别因为这个映像文件是以 loop 安装的而不敢移动或重新命名它。 文件系统使用 inode,即使你移动或重新命名它,inode 保持不变。 你不会伤害到安装在 /mnt 下的文件系统。 至于删除 ISO 文件,那同样不会损害已安装的文件系统;一个文件的 inode 只有当它的引用计数减为零时才会被释放。 安装 ISO 文件使引用计数增加,所以该文件只有在你 rm删除它卸载它后才真正被删除。正在更新 CD 的你们不必为此担心。 :-) 我将会把该 ISO 文件改名为 woody-i386-1.iso.old 并重新运行 jigdo-lite。让我们再试一次: $ jigdo-lite woody-i386-1.iso.jigdo ----------------------------------------------------------------- Jigsaw Download "lite" Copyright 2001-2002 by Richard Atterer <jigdo@atterer.net> Loading settings from `/home/p/.jigdo-lite' ----------------------------------------------------------------- Images offered by `woody-i386-1.iso.jigdo': 1: Debian GNU/Linux 3.0 r0 Woody - Official i386 Binary-1 CD (debian-30r0-i386-binary-1.iso) Further information about `debian-30r0-i386-binary-1.iso': Generated on Thu, 18 Jul 2002 14:34:12 +0100 ----------------------------------------------------------------- If you already have a previous version of the image you are downloading, jigdo can re-use files on the old image that are also present on the new image, and you do not need to download them again. Mount the old CD ROM and enter the path it is mounted under (e.g. `/mnt/cdrom'). Alternatively, just press enter if you want to start the download of any remaining files. You can also enter a single digit from the list below to select the respective entry for scanning: 1: /mnt Files to scan: /mnt Not downloading .template file - `woody-i386-1.template' already present ... Found 1200 of the 1224 files required by the template ... jigdo-lite 记住了我想要扫描 /mnt 并告诉我可以敲入 1 或再次输入该目录。我再次输入了目录的名字。 省略号代表某些文字快速改变。第一个省略号是 jigdo-lite 正在扫描的文件的动态列表,第二个省略号表示正在写 woody-i386-1.iso.tmp 的进度。一旦 jigdo-lite 完成扫描这些文件和写好 ISO 的临时文件,它打印出: Copied input files to temporary file `woody-i386-1.iso.tmp' - repeat command and supply more files to continue ----------------------------------------------------------------- If you already have a previous version of the image you are downloading, jigdo can re-use files on the old image that are also present on the new image, and you do not need to download them again. Mount the old CD ROM and enter the path it is mounted under (e.g. `/mnt/cdrom'). Alternatively, just press enter if you want to start the download of any remaining files. You can also enter a single digit from the list below to select the respective entry for scanning: 1: /mnt Files to scan: 因为通常你除了以 loop 方式安装的 ISO 文件(或你的 CD )并没有另外的文件来源需要扫描,按 <ENTER>。Jigdo-lite将问你想使用哪一个镜像站点,就如你第一次下载ISO文件时它问的一样。你之前已经回答过这些问题,但如果你真的忘了,你可能要重新阅读 到这里时,你将看到jigdo-lite正在施展它的魔法。这不是很简单吗? 常见问答(FAQ) 带有日期的预先计划的问题表明这些问题是时间敏感(time sensitive),换句话说,这个问题与一种临时条件有关。如果你看到这些问题之一并且知道临时条件已发生变化,请与我联系并让我知道,以便我能将该问题从这个 mini-HOWTO中删除掉。 [11 Aug 2002]: 我看到 Woody 和 Sid 的 .jigdo 文件。Sarge 的 .jigdo 文件在哪里? 在此刻 testing 版本的 ISO 映像因为引导软盘损坏而不能提供。当它们修复好以后,Sarge 每周快照的 .jigdo 文件将会在一个半官方的来源(可能是http://non-us.cdimage.debian.org)上提供。 [11 Aug 2002]:我能否同时在同一个目录上运行两个 jigdo-lite 会话? 现在不行。两个会话会在 tmp/jigdo-file-cache.db 文件上发生冲突。这个问题正在解决中。如果你想并发地运行 jigdo-lite 会话,使用不同的工作目录。 [11 Aug 2002]: 为什么 LDP 上没有这个 HOWTO 文件的译文? I've been having trouble getting the translations of this HOWTO submitted to the non-English LDP editors. The German LDP editor, Marco Budde Budde@tu-harburg.de refuses to accept the German translation because it was written in Docbook and not Linuxdoc, even though Docbook is the preferred SGML language for the LDP. The Portuguese LDP editor, Alfredo Carvalho ajpc@poli.org and Spanish LDP editors, (no name) pacopepe@insflug.org and Ismael Olea ismael@olea.org have completely ignored my submission of the Portuguese and Spanish translations. If you care about having LDP documents in these languages, I urge you to write to these editors and ask them to please be more responsible about accepting translated documents. For the time being, you can download these translations from my personal website, http://www.dirac.org/linux/debian/jigdo. How can I make jigdo use a proxy? This is described on http://debian.org/CD/jigdo-cd/ as well as the README of the jigdo-lite tarball. What do I do if my jigdo download gets interrupted? If your download gets interrupted, all you need to do is restart jigdo-lite and hit <ENTER> at all the question prompts. Jigdo-lite will pick up where it left off. My jigdo download won't complete because the .jigdo file is broken. When I download a new, fixed .jigdo file, do I need to download all the data over again? You may find that the .jigdo file you downloaded is broken. It's very uncommon, but it does happen from time to time with moving targets like Debian testing or unstable. If you find that your .jigdo file is broken, you'll need to download a new .jigdo file (when a fixed one becomes available), but you won't need to download all the ISO data again. You can use the same loop mounting trick we use when updating an ISO image. The difference is that there's no finished .iso file to start with, but the .iso.tmp file is an ISO image too and can be used to finish the download without having to re-download all the data that was downloaded before the broken .jigdo file caused jigdo-file to halt. Simply loop mount the .tmp.iso file on /mnt and when you re-run jigdo-lite with the fixed .jigdo file, tell jigdo-lite to scan /mnt. Don't forget to rename or move the .tmp.iso file so it doesn't interfere with jigdo-lite which will want to create a new .tmp.iso file. Can I use jigdo to download images for DVD? Absolutely; the process is identical to downloading CD images. The only thing you need to do differently is to download the .jigdo and .template files for DVDs instead of CDs. You can find the DVD .jigdo and .template files at http://www.debian.org/CD/jigdo-cd/. Note that you need Linux 2.4 or later to create DVD-sized files. Under Windows, DVD-sized images can't be created at all at the moment because the C++ library of the mingw gcc port doesn't have big file support yet. Can I burn the <filename>.iso.tmp</filename> file to CD? We haven't tried yet, but it should be possible. You'd probably find some files are filled with "0"'s. If someone tries it, please contact me at p@dirac.org and let me know what happened. But more importantly, why would you WANT to do this?   :-) Why doesn't jigdo work? It downloads some packages and deletes them. I know it doesn't write them to the <filename>iso.tmp</filename> file because the file size doesn't change! Jigdo works just fine - the .iso.tmp file is created at the beginning with its final size, but filled with zero bytes. Later, parts of it are overwritten with the downloaded data. You can tell that jigdo is making progress by looking at the messages "Found X of the Y files required by the template" that are printed from time to time. The second value "Y" should decrease. When it reaches zero, the download is finished. I'm having trouble getting jigdo-easy to work. See . I'm having trouble getting jigdo to download Sarge or Sid. If you're using Potato or Woody, upgrade to jigdo-lite 0.6.8. Because of a change in Jigdo, the version of jigdo-lite that comes with Woody (rev 0) cannot download Sarge and Sid images. The version that comes with Sarge is sufficient (). If you're using Sarge or Sid, then you may need some help. Search the archives of the debian-cd mailing list, and if that doesn't solve your problem, you should send them a request for help (). Jigdo-lite is too verbose. How can I supress some or all of its messages? Jigdo-lite uses wget, and wget's output can be quite verbose. If this is unsettling, you can make wget more quiet by adding --non-verbose to the wgetOpts switch in your ~/.jigdo-lite file. If you want wget to print no messages at all, use --quiet in the wgetOpts switch. Can I use jigdo on platforms other than Linux? Certainly. If you're interested in Potato or Woody under Microsoft Windows, old SunOS, HP-UX and IRIX you can use jigdo-easy. See and . If you want to download Potato, Woody, Sarge or Sid under Microsoft Windows, jigdo-lite has been ported to that platform and can be downloaded from the main jigdo site (). Errata jigdo-easy Jigdo-easy, by Anne Bezemer, is a fork from jigdo-lite which is portable to a wider range of systems, including Microsoft Windows, old SunOS, HP-UX and IRIX). It's also easier to use than jigdo-lite but because of changes made to Jigdo, will only work with Potato and Woody. Jigdo-easy will not be able to download Sarge and Sid. See and . GUI Interface A GTK+ interface to jigdo is currently being worked on. It's not fully functional yet, but will be available at some point. There will be a Linux as well as a Windows GUI client. jigdo-file-cache.db The cache contains the md5sums of files read when you supply a directory at the Files to scan: prompt. If you have jigdo-file scan the same directory a second time, the scan will be very fast. This could be useful in the following case: rev0 gets updated to rev1. With the rev1 CD images, some packages may have been pushed from CD n to CD n+1, or vice versa. If you had a particularly slow link (e.g. modem), you'd try to avoid downloading these packages again. For this reason, when downloading the new version of CD n, you'd let jigdo-lite scan the three CDs n-1, n and n+1 (or even all 8 CDs if you want to be 100% sure). If you have jigdo-lite scan the same CDs over and over again while updating each of the 8 CD images, the cache will prevent all the data on the CDs from being read multiple times. The cache is much more important when generating jigdo files, because you don't want jigdo-file to read in your whole 50GB Debian mirror for every generated jigdo file. Resources This HOWTO is winding down to a close, but I thought I'd leave you with a few links and references to learn more about the jigdo tools and how they work. http://atterer.net/jigdo This is the jigdo home site. You should definitely browse this site; lots of information about ports, GUI clients and everything under the sun relating to jigdo. http://cdimage.debian.org/~costar/jigdo The Debian page for jigdo-easy (). http://www.debian.org/CD/jigdo-cd The main Debian page for jigdo. http://packages.debian.org/testing/utils/jigdo-file.html If you're using Potato or Woody, please upgrade jigdo-file to version 0.6.8, which comes with Sarge (). http://lists.debian.org/search.html You can use this page to search the debian-cd mailing list archives. http://www.debian.org/MailingLists/subscribe The subscription page for the debian-cd mailing list.