Beginner's Guide to Mirror

Beginner's Quickstart Guide to Mirror

Mirroring a Debian binary distribution by FTP.

Copyright (C) 2001-2003 Ian Maclaine-cross <iml@debian.org>. You may use this only under the conditions of the General Public License in file GPL.

This worked for me and "sarge" on 2 March 2003. Future Debian archive changes require adjustments to these instructions. Please back up your system before trying this as mistakes by you or errors in the software or this document can cause a complete loss of data. The steps are:---

  1. Try "$ ftp ftp.us.debian.org" with username "ftp" and password "username@" where username is your current login name. Then "ftp> cd debian" and "ftp> ls". Note down the names and sizes of the README files then "ftp> bye". If this does not work you do not have an FTP client installed or have no FTP connection to the Internet. Until this is remedied you should not attempt to install or use mirror.
  2. Install the mirror package using dselect or dpkg.
  3. As root with "crontab -e" add these three lines to root's crontab:
    3 13 * * * nice mirror-master /etc/mirror/mm/debian-dist &>/dev/null
    3 1 * * * nice mirror-master -t /etc/mirror/mm/debian-dist
    * * * * * touch /tmp/cron.marker
    

    Run "ls -l /tmp" a few minutes apart to see if cron is working and updating the timestamp on cron.marker every minute. Your computer needs to run and be connected to the Internet all night. Do not forget to turn the monitor off.

  4. Next day check that cron is still working with "ls -l /tmp". The directory /var/log/mirror/ should have eight files listing the files downloaded and mm.status recording when the packages were run. See if directories /home/ftp/pub/debian/ and /var/lib/mirror/debian-non-US/ have the Debian READMEs and the directory listing files remote_ls-lR. Directory /var/lib/mirror/debian-security/ should have a README. The subdirectory dists/ should have empty directories and links. Write down the subdirectory name which the "stable" link points to. The ".mirror" files also log the results of the mirror run. If this did not work read the fine manuals starting with "man mirror" and proceed no further until the problem is remedied. You may have a proxy server or need passive FTP.
  5. Check with df whether you have >10 GB of free hard disk space in the partition containing /home/ftp/pub/. Can you afford the download charges for even the 6 GB for "sarge"? It is best if you have no download charges so check with your ISP. Distributions after "sarge" require much more.
  6. "$ mirrors -f debian" should give you the closest mirrors if they are unknown. In the USA you also need an overseas mirror for debian-non-US. Edit /etc/mirror/packages/debian-dist as requested in the comments at the top of the file.
  7. Check the README and other text files you find with "ftp" at your chosen mirror to see if they permit you to mirror them freely. If they do not choose another Debian mirror with "mirrors" and the "Debian worldwide mirror sites" list. There are over 200 sites worldwide who permit free mirroring of Debian to all. You do not wish to pay your mirror as well as your ISP for download charges.
  8. Third day check to see if you have most of the stable distribution. One day soon you should get the result "No files to transfer" in both ".mirror" files. You can now uncomment the "get_symlink_files=" line in packages/debian-dist to drag in missing "Not symlinking ... as no path ..." files referred to in "/var/log/mirror/".
  9. If all these steps worked change dselect to install packages from debian/ and debian-non-US/ and test them by installing some new packages. If the packages install, well done! Otherwise check the steps and read the manuals.
  10. Read the manuals in /usr/share/doc/mirror/html/ for more complex tasks and fine-tuning.
Ian Maclaine-cross 2003/03/02