Setting up apt-cacher on Ubuntu 10.04

On repository server:

  1. Download:
    apt-get install apt-cacher apache2
  2. Get it to auto-start by editing /etc/default/apt-cacher and change autostart to 1
  3. Modify any config options in /etc/apt-cacher/apt-cacher/conf (not required)
  4. Restart apt-cacher – this will create the log files
    /etc/init.d/apt-cacher restart
  5. Import any existing apt-get cache (not sure exactly what this is for, but the documentation mentions it)
    /usr/share/apt-cacher/apt-cacher-import.pl -s /var/cache/apt/archives

On client server:

  1. Modify the sources list at /etc/apt/sources.list, like so:
    cp /etc/apt/sources.list /etc/apt/sources.list.bak
    vi /etc/apt/sources.list
    :%s/gb.archive.ubuntu.com/[your.repo.server]:3142\/gb.archive.ubuntu.com/g
    :%s/security.ubuntu.com/[your.repo.server]:3142\/security.ubuntu.com/g
    :wq!
  2. Reload the apt list
    apt-get update
  3. Try and install something

Leave a Reply

Your email address will not be published. Required fields are marked *