How to configure a proxy for APT

Ubuntu 8.10 server

  1. sudo apt-get install apt-proxy
    1. sudo editor /etc/apt-proxy/apt-proxy-v2.conf
        1. Add your local mirror to the [ubuntu] backends, for example in Canada:
          1. [ubuntu] ;; Ubuntu archive backends = http://ca.archive.ubuntu.com/ubuntu/ http://archive.ubuntu.com/ubuntu
  2. sudo /etc/init.d/apt-proxy restart

Ubuntu 8.10 client

    1. sudo editor /etc/apt/sources.list
        1. Replace all instances of *.archive.ubuntu.com and security.ubuntu.com with your APT proxy server's address, which will look like 192.168.0.42:9999
  1. sudo apt-get update

Source: Save bandwidth and time with apt-proxy