Create Ubuntu Apt Mirror on CentOS Server

I run a CentOS server that contains a complete mirror of the CentOS repositories that we use for all our servers at work. This saves a lot of time/bandwidth as the local mirror syncs itself with the outside world once a day (around midnight) and all the local servers point at the local mirror for installs or updates.  Well, we also have a lot of Ubuntu desktops so I wanted to use the same machine to also create a local Ubuntu repository. The tool of choice for this job is apt-mirror. I couldn’t find an RPM (and my initial attempt at downloading the source and building was missing some prerequisites and had issues) so I figured, why not use Ubuntu to create an Ubuntu repository. I didn’t want to have a machine dedicated to this purpose, so in comes my favorite tool for Debian/Ubuntu systems: debootstrap. Fortunately, there is an RPM for debootstrap for FC10, but since it only relies on Python it can be downloaded and installed directly into CentOS 5.2.  So to get a base Ubuntu install created do the following steps (at this time the highest release in Fedora’s RPM is intrepid, but that will work for our purposes):

  1. Download debootstrap RPM< it is the same for i386 and X86_64 systems.
  2. # rpm -ivh debootstrap-1.0.10-1.fc10.noarch.rpm
  3. # mkdir /chroot
  4. # deboostrap --arch (amd64 or i386) intrepid /chroot/ubuntu-8.10
  5. # chroot /chroot/ubuntu-8.10
  6. (inside-chroot)# apt-get update
  7. #apt-get install apt-mirror
Story URL: