mirror cygwin for local installation – enhanced version of mkcygwget

If you plan to install cygwin on a couple of computers or on a host with limited internet access you might want to have a local mirror of the installation packages for setup.exe . There’s already a handy script called mkcygwegt which does the job for you. All you have to do is to provide a mirror URL. It downloads setup.ini then parses it and generates a file which consists of the apporpriate wget calls (cygwget).

However, I was not really contend with this script and improved a bit the way how cygwget is generated:

  1. Instead of calling wget directly for each request, a xargs call is used now.
  2. wget is now called with “-n” option to enable timestamping. So for subsequent calls of cygwegt it downloads only new files. And you are also able to resume an interrupted download
  3. A new sed statement makes sure that only the actual version of a package is downloaded. The former behaviour was to also download the previous version (if it existed in setup.ini). Now a complete install of all packages fits on a CD-ROM (approx. 655 MiB used). 😉

You can download it as mkcygwget or only the mkcywget_diff.

Of course there are some things which cannot be changed so quickly:

  • Its not a real mirroring. Old versions in the local release directory are not deleted automatically.
  • For every file wget opens a new connection to the server. This is not really smart and some servers perhaps trottle your IP if they observer such an behaviour.