Debian 镜像下载的最佳方式—— jigdo

来源:
debian.org/CD/jigdo-cd/
tldp.org/HOWTO/Debian-Jigdo/whyjigdo.html
tldp.org/HOWTO/Debian-Jigdo/updatingyourimage.html

  1. 什么是jigdo

jigdo是一种下载工具,意为“拼图下载”(jigsaw download),关于它的介绍,见atterer.org/jigdo/

  1. 为什么要用jigdo下载镜像文件

打开debian.org/CD/,会看到5种获取CD/DVD镜像的方式。最容易理解的方式自然是直接下载(debian.org/CD/http-ftp/)。然而相比于直接下载,jigdo下载有一个优点:便于更新。简单地说,在用户完成了首次镜像下载后,网站上的镜像文件可能会作出更新。用户若要跟进更新的版本,按直接下载的方式,就要重新完整下载新的镜像。然而使用jigdo方式,则可以在下载前扫描已经下载的镜像文件,并与网站上的更新版本作比较,只下载有改动的部分,最后自动形成新的镜像文件。这样会极大节省用户跟进新版本镜像的时间,提高效率。jigdo就是jigsaw downloading的缩写,意为“拼图下载”。当然,这种下载方式对于镜像网站而言,也会极大降低访问压力。所以jigdo是一种双赢的下载方案。

关于使用jigdo的意义,详见tldp.org/HOWTO/Debian-Jigdo/whyjigdo.html。这一页的最后一句说:Clearly, jigdo is the best method of obtaining Debian ISO images.

  1. 首次下载镜像

3.1 下载Debian的jigdo文件和template文件,如cdimage.debian.org/debian-cd/8.3.0/amd64/jigdo-cd/中的debian-8.3.0-amd64-xfce-CD-1.jigdo和 debian-8.3.0-amd64-xfce-CD-1.template。
3.2 下载jigdo,见atterer.org/jigdo/#download
3.3 解压为文件夹jigdo-bin-0.7.3。为方便今后更新,可将前面两个文件置于该文件夹中。
3.4 直接在该目录下运行命令./jigdo-lite debian-8.3.0-amd64-xfce-CD-1.jigdo
3.5 按提示输入待扫描的iso文件,若尚没有下载,就回车跳过。
3.6 提示输入iso文件所在的镜像网站,可参照debian.org/CD/http-ftp/#mirrors,选择一个连接速度较快的地址,我这里输入的是ftp://mirrors.sohu.com/debian。然后回车看jigdo奔跑的样子吧。

  1. 更新镜像

4.1 当你发现下载的镜像已经过时了,就可以施展jigdo的威力了。
4.2 如果当前文件夹下有原有的iso文件,最好给它换个地方或者改个名。这是给新的iso文件腾个地方,否则会报错。
4.3 一定要下载新的.jigdo文件和.tmeplate文件。这两个文件是对应镜像的文件。
4.3 将原有的iso文件加载到一个文件夹中,比如/mnt:sudo mount -o loop debian-8.3.0-amd64-xfce-CD-1.iso /mnt
4.4 运行jigdo-lite

4.5 当询问扫描的文件时,输入镜像加载的目录,这里是/mnt。回车看jigdo的表演了。我这里下的是最新的,所以事实上没有更新。但照样生成了一个基于原来内容的新的镜像文件debian-8.3.0-amd64-xfce-CD-1.iso。
4.6 记得卸载那个镜像:sudo umount /mnt。

[code]
./jigdo-lite debian-8.3.0-amd64-xfce-CD-1.jigdo

Jigsaw Download "lite"
Copyright © 2001-2005 | jigdo@
Richard Atterer | atterer.net
Loading settings from `/home/yangdawei/.jigdo-lite’


Images offered by `debian-8.3.0-amd64-xfce-CD-1.jigdo’:
1: ‘Debian GNU/Linux 8.3.0 “Jessie” - Official amd64 xfce-CD Binary-1 20160123-19:00 (20160123)’ (debian-8.3.0-amd64-xfce-CD-1.iso)

Further information about `debian-8.3.0-amd64-xfce-CD-1.iso’:
Generated on Sat, 23 Jan 2016 19:04:27 +0000


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:/mnt

Not downloading .template file - debian-8.3.0-amd64-xfce-CD-1.template' already present Found 1531 of the 1531 files required by the template Successfully createddebian-8.3.0-amd64-xfce-CD-1.iso’


Finished!
The fact that you got this far is a strong indication that `debian-8.3.0-amd64-xfce-CD-1.iso’
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! [/code]

国内还是迅雷好。