当前位置: 首页>>技术教程>>正文


如何通过不可靠的连接下载 Ubuntu

问题描述

我正在尝试通过极其不可靠的连接下载 64 位 Ubuntu 12.10 ISO。不可靠是指每次我完成 ISO 下载并比较 MD5 哈希值时,我都会收到有关不匹配的错误。

我正在使用 Ubuntu 12.04 来执行下载。有没有一种工具可以以某种方式绕过非常不可靠的连接?

最佳答案

在我的例子中,我的连接经常掉线,如果尝试直接下载 ISO,我也会遇到 MD5 问题。我推荐的是通过 Torrent 客户端下载 ISO 映像。

这样,即使在下载时,torrent 客户端也会检查以确保它是正确的。有一个 good list of torrents to use 但如果您使用的是 Windows 或 Mac,我建议使用 UTorrent 。如果您在安装了 Ubuntu 的计算机上执行此操作,Ubuntu 会附带一个名为 Transmission 的默认 torrent 客户端。

您可以找到 torrent download file in the ubuntu site 只需查找具有 .torrent 文件扩展名的文件。

次佳答案

除了 bittorrent 之外,您还可以为此使用 zsync(免费工具)。

您可能想知道 zsync 是如何工作的,以便决定是否要获取和使用它,所以我先解释它的工作原理,然后再解释如何获取它。

如何使用 zsync 下载 Ubuntu ISO 映像

zsync 允许您从一个文件开始构建另一个文件。您可以从任何文件开始,但为了比简单地下载您需要的文件更有优势,您开始的文件应该与您想要的文件相似。

zsync 仅适用于提供者已创建 .zsync 图元文件的文件。 .zsync 文件包含文件部分的校验和,并使 zsync 实用程序能够确定文件的哪些部分已经匹配,哪些部分不匹配。不匹配的部分重新下载。 (实际上,zsync 更复杂一些——它还能够处理某些部分匹配但位于文件中不同位置的情况,而无需重新下载那些匹配的部分。该特定功能通常不会有助于创建一个好的但是,来自损坏下载的文件。)

在某处下载(损坏的)ISO 映像后,打开终端或(对于 Windows)命令提示符 (cmd.exe) 并导航至其位置。在大多数操作系统中,您可以在末尾键入带空格的 cd,然后将文件夹拖到命令行,文件夹的位置将被粘贴。然后你可以按回车键,它会将目录更改到该位置。 ( cd 应该是小写——在某些系统上,如 Windows,大写可以工作,但在其他系统上,如 OS X 和 Ubuntu,则不会。)

一旦进入包含该文件的文件夹——运行 lsdir 应该会显示其中的所有内容,运行 ls *.isodir *.iso 应该只显示以 .iso 结尾的文件,其中包括 Ubuntu 安装映像——然后运行:

zsync URL-to-.zsync-file Ubuntu-iso-image-name.iso 

这将修补您拥有的损坏文件(命名为 Ubuntu-iso-image-name.iso ——例如,它可能被称为 ubuntu-12.10-desktop-i386.iso )是正确的。如果您运行它并且没有进行任何更改,则意味着您的文件是正确的。 zsync 包含校验和,因此您可以确定您拥有一个完整、正确的文件(如果有的话)。

要准确了解如何在多个平台上获取 .zsync,以及如何为每个 Ubuntu ISO 映像运行它,请继续阅读。

获取 zsync 实用程序

我之前在不同的上下文中写过有关获取和使用 zsync 修复损坏的 ISO 映像的文章。它在 a longer answer 中,其中大部分与这里的这个问题无关。所以我摘录了其中相关的部分。

\\n

Getting zsync for Windows

\\n

zsync traditionally runs on Unix-like system (which doesn’t really\\n include Windows). However, recently a native Windows port of zsync\\n has been created, so you can probably use that.

\\n

zsync is a command-line program, so in Windows you run it in the\\n Command Prompt. (One way to open the command-prompt is to type\\n cmd.exe into the text box in the Start menu and press\\n Enter. Or, in Windows XP and earlier, Start > Run >\\n cmd.exe.)

\\n

Another Way: Getting zsync for Cygwin

\\n

If you have any problems with the Windows port of zsync, you can\\n always use the Cygwin version. Cygwin provides a Unix-like environment\\n for Windows. It does not allow compiled executables to be run (for\\n example, you could not use zsync from the Ubuntu package), but uses\\n special versions of programs compiled for it from source. (It is far\\n easier to compile a program written for Unix-like operating systems in\\n Cygwin, than to compile it so it works natively on Windows.)

\\n

    \\n

  1. First, get Cygwin’s installer (setup.exe) from here (or use this direct link).
  2. \\n

  3. Run it, click Next on the first screen, then select Install from Internet and click Next again.
  4. \\n

  5. On the next two screens, put Cygwin and the local package directory wherever you like them (defaults are usually good).
  6. \\n

  7. Select your Internet connection type (Direct Connection is usually good), and setup.exe will download a list of mirrors.
  8. \\n

  9. Pick any mirror, and it will download a list of available packages. You’ll probably be warned about how this version is different from the\\n previous one. That’s not a problem, unless you’ve been using a\\n previous version of Cygwin on the same machine.

    \\n

    Setup Alert message about how how this is the first time you've installed this particular version of Cygwin. If you haven't used Cygwin before, this can be ignored. As it says, "If this is the first time you've installed Cygwin on this system then you can ignore this message."

  10. \\n

  11. Now you can select what packages to install. There is a text box for searching packages by name. Type zsync there (but do not press\\n Enter–if you do, it’s like clicking Next). An entry for\\n Net will appear. Expand it by clicking the + to the left of it and you’ll see Skip appear under it. That means if you don’t\\n change anything, setup.exe will not install zsync.

    \\n

    Velma Dinkley installs zsync in Cygwin while updating her blog in "Siren's Song."

  12. \\n

  13. So click once, where it says Skip. Now it will install the latest available stable version of zsync for Cygwin.

    \\n

    enter image description here

  14. \\n

  15. Click Next again to finish the installation. The Cygwin environment, and zsync, will be downloaded and installed. (If you’re\\n asked to install packages that are required as dependencies, go ahead\\n and do so.)
  16. \\n

\\n

Once it’s installed, open the Cygwin shell. You can run zsync from\\n there.

\\n

\\n

References

\\n

\\n

Please note that while you can post on the Cygwin mailing list\\n for problems with Cygwin (after reading that and the materials it\\n tells you to read), they understandably do not support unofficial\\n instructions. cygwin has quite good documentation, so like other\\n projects with good centralized documentation (like OpenBSD), they\\n expect that people asking for help will have read the documentation\\n and are working from (or at least very familiar with) it.

\\n

(Therefore, if you have trouble with my instructions, the best place\\n to ask about them is probably here.)

\\n

\\n

zsync on Ubuntu

\\n

This doesn’t apply in your specific case, but for folks who want to\\n use zsync on Ubuntu, just install zsync Install zsync.\\n This can be done in the Software Center or by running this in a\\n Terminal window (Ctrl+Alt+T):

\\n

sudo apt-get update && sudo apt-get install zsync\\n

\\n

Now you can run it from the Terminal.

\\n

my answerHow to identify and replace broken files in a corrupted Ubuntu ISO?

使用 .zsync 修复最常见的 Ubuntu ISO 文件

首先,cd 到包含损坏的 .iso 映像的位置,如上文所述(在如何使用 zsync 下载 Ubuntu ISO 映像中)。

\\n

Now run zsync in one of these ways, depending on which Ubuntu ISO\\n image it is:

\\n

    \\n

  • 12.10, 32-bit:

    \\n

    zsync http://releases.ubuntu.com/quantal/ubuntu-12.10-desktop-i386.iso.zsync\\n
  • \\n

  • 12.10, 64-bit:

    \\n

    zsync http://releases.ubuntu.com/quantal/ubuntu-12.10-desktop-amd64.iso.zsync\\n
  • \\n

  • 12.04.1 LTS, 32-bit:

    \\n

    zsync http://releases.ubuntu.com/12.04.1/ubuntu-12.04.1-desktop-i386.iso.zsync\\n
  • \\n

  • 12.04.1 LTS, 64-bit:

    \\n

    zsync http://releases.ubuntu.com/12.04.1/ubuntu-12.04.1-desktop-amd64.iso.zsync\\n
  • \\n

  • 12.04 LTS (before the 12.04.1 point release), 32-bit:

    \\n

    zsync http://old-releases.ubuntu.com/releases/precise/ubuntu-12.04-desktop-i386.iso.zsync\\n
  • \\n

  • 12.04 LTS (before the 12.04.1 point release), 64-bit:

    \\n

    zsync http://old-releases.ubuntu.com/releases/precise/ubuntu-12.04-desktop-amd64.iso.zsync\\n
  • \\n

\\n

Once you run one of those commands, zsync will automatically patch your ISO up to the correct version, and you’re good to go.

\\n

my answerHow to identify and replace broken files in a corrupted Ubuntu ISO?

为其他(和未来的)Ubuntu .iso 映像编写 zsync 命令

\\n

The general syntax is that you run zsync followed by a complete URL\\n for the .zsync file on the server that has the same name as the file\\n you have a version of and wish to download (except with .zsync at\\n the end of course).

\\n

In case anyone wants to do this for any other Ubuntu releases (or\\n other ISO files for the same release, like the version optimized for\\n booting properly on Macs or the version for ARM-based mobile devices)\\n here’s the rule for where the .zsync files are located:

\\n

    \\n

  • ISO images containing currently supported installers, including ISO’s for the latest point release of LTS releases and all ISO’s for\\n currently supported LTS releases, are located in:

    \\n

    http://releases.ubuntu.com/

  • \\n

  • ISO images for end-of-life releases (which you shouldn’t use anyway) or previous point releases of supported LTS releases are located in:

    \\n

    http://old-releases.ubuntu.com/releases/

  • \\n

\\n

Just click the link for your version and scroll down to see the full\\n file list (or search the page for .zsync). Then copy the URL and\\n paste it in the zsync command.

\\n

my answerHow to identify and replace broken files in a corrupted Ubuntu ISO?

虽然它比这要广泛得多(我不建议将它们视为重复!),但如果您有兴趣,您可能想看看最初导致我在这里写下大部分文本的问题(即,块引号中的文本):

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/13251.html,未经允许,请勿转载。