4. 下载您的首个镜像文件(共 5 个简单步骤)

我们将假设您从零开始,手头没有任何 Debian ISO 镜像文件。一旦您刻录好 ISO 镜像集,您之后可以使用 jigdo-lite 来更新它们。我们将在下一节介绍更新您的 ISO 镜像。

4.1. 安装 Jigdo

首先安装 jigdo-file 软件包

      # apt-get install jigdo-file
      

Jigdo 正在积极开发中。错误修复和功能增强是持续不断的,所以如果您使用的是 stable 或 testing 版本,请从 unstable 版本下载 jigdo-file,网址为 http://packages.debian.org/unstable/utils/jigdo-file.html。截至 2005 年 11 月 28 日,它的版本是 0.7.2-2。

4.2. 下载 .template 和 .jigdo 文件

对于您想要下载的每个 ISO 镜像文件,您都需要该镜像文件的 .jigdo 和 .template 文件。这两个文件都遵循相同的命名约定

      distro-arch-n.jigdo
      distro-arch-n.template
      

其中 distro 是发行版名称(例如“sarge”),arch 是架构(例如“i386”),n 是磁盘编号(例如“1”)。

例如,sarge 有 8 个镜像文件,因此您需要下载 8 个 .jigdo 文件和 8 个 .template 文件。它们可以从 http://www.debian.org/CD/jigdo-cd/ 下载。第一个 .jigdo 和 .template 文件的名称分别为sarge-i386-1.jigdosarge-i386-1.template

4.3. 运行 jigdo-lite

运行 jigdo-lite 并提供给它您想要下载的镜像文件的.jigdo文件。以 Sarge 为例

      lucifer$ ls
      sarge-i386-1.jigdo  sarge-i386-1.template
      lucifer$ jigdo-lite sarge-i386-1.jigdo 
      
      Jigsaw Download "lite"
      Copyright 2001-2003 by Richard Atterer <jigdo@atterer.net>
      Getting mirror information from /etc/apt/sources.list
      
      -----------------------------------------------------------------
      Images offered by `sarge-i386-1.jigdo':
        1: 'Debian GNU/Linux testing "Sarge"
               - Official Snapshot i386 Binary-1 CD' (sarge-i386-1.iso)
      
      Further information about `sarge-i386-1.iso':
      Generated on Fri, 7 Feb 2003 20:31:28 -0700
      
      -----------------------------------------------------------------
      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 in 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 downloading
      the remaining files.
      Files to scan:
      

如果您使用 control+z 暂停了 jigdo-lite(不要这样做;我会告诉您您会看到什么),并查看 ls 的输出,您会在目录中找到一个名为sarge-i386-1.jigdo.unpacked的新文件。.jigdo 文件实际上是 gzip 压缩的。这个文件只是.jigdo文件的 gunzip 解压缩版本。

现在,jigdo-lite 正在告诉我们,如果我们有 sarge 首张 CD 的过时版本,我们应该提供 CD 的路径名。这就是您更新 ISO 镜像(或完成未完成的下载)的方式。由于我们假设您从零开始,并且还没有 Debian ISO 镜像,所以我们没有要扫描的内容。我们将在第 5 节中介绍这一点,所以只需按 ENTER

另请参阅 第 7.2 节,“关于扫描源的更多信息”。

4.4. 指定镜像

您将看到

      -----------------------------------------------------------------
      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中拉取镜像。如果您想使用不同的镜像,您可以在此处指定不同的镜像。如果这是您想要使用的镜像,请按 ENTERJigdo-lite 随后将在您的主目录中写入一个.jigdo-lite文件。

接下来,如果您使用的.jigdo文件引用了一个需要从 Non-US 服务器下载的软件包,jigdo-lite 将提示您输入 Debian 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 会将您的选择写入~/.jigdo-lite。但是,如果您即将下载的镜像不包含 Non-US 软件,您将不会看到此对话框。

如果您想在将来任何时候更改您与 jigdo 一起使用的默认镜像,您可以修改~/.jigdo-lite:

      debianMirror='http://some-mirror-to-use/debian/'
      nonusMirror='http://some-other-mirror/debian-non-US/'
      

4.5. ISO 镜像的下载

在您指定镜像后,jigdo-lite 将开始下载文件以组装 ISO 镜像

      Not downloading .template file - `sarge-i386-1.template' already present
      
      -----------------------------------------------------------------
      Merging parts from `file:' URIs, if any...
      Found 0 of the 826 files required by the template
      Will not create image or temporary file - try again with different input files
      --09:35:12--  http://mirror/debian/pool/main/p/pack/pack_3.10-1_i386.deb
          => `sarge-i386-1.iso.tmpdir/mirror/debian/pool/main/p/pack/pack_3.10-1_i386.deb
      Resolving linux.csua.berkeley.edu... done.
      Connecting to linux.csua.berkeley.edu[128.32.112.231]:80... connected.
      HTTP request sent, awaiting response... 200 OK
      Length: 1,911,624 [application/x-debian-package]
      
      19% [======>                              ] 378,304      149.87K/s    ETA 00:09
      

屏幕上会飞过很多消息;如果您对此感到困惑,请参阅 第 6.13 节。当 jigdo-lite 正在下载软件包时,切换到另一个控制台(或打开另一个 xterm)并在您运行 jigdo-lite 的目录中执行 ls。现在目录中应该有 6 个文件

目录包含 jigdo-lite 下载的所有 Debian 软件包。目录会定期刷新,文件会被写入到sarge-i386-1.iso.tmpdir/目录包含 jigdo-lite 下载的所有 Debian 软件包。目录会定期刷新,文件会被写入到sarge-i386-1.iso.tmp,它是您想要的 ISO 镜像的临时不完整版本。请注意,sarge-i386-1.iso.tmp在第一次sarge-i386-1.iso.tmpdir/被刷新之前不会出现。

jigdo-file-cache.db是一个 Berekeley DB 文件,其中包含在您在要扫描的文件提示符下指定目录时读取的任何文件的 md5sum 值。它在 第 7.3 节中进行了描述。

此时,去玩一些 Quake III 吧,因为这会花费一些时间(您可能想在另一台机器上玩,因为当 jigdo 将文件刷新到.iso.tmp文件时,磁盘操作非常密集)。在某个时候,下载将完成,您将看到

      FINISHED --13:32:58--
      Downloaded: 7,469,872 bytes in 9 files
      Found 9 of the 9 files required by the template                              
      Successfully created `sarge-i386-3.raw'
      
      -----------------------------------------------------------------
      Finished!
      The fact that you got this far is a strong indication that `sarge-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!