||<>|| = Introduction = Same install procedure as http://www.debuntu.org/how-to-set-up-a-repository-cache-with-apt-cacher with some Ubuntu specifics added. == Warning: Using Apt-Cacher with more than one distribution == Because Debian and Ubuntu have identically named (but different) .deb packages in their repositories, it is unwise to setup a single apt-cacher to be a caching package server for both Debian and Ubuntu clients at the same time. A workaround for advanced users is to run two separate instances of apt-cacher on two separate ports with two separate caches. = Server Installation = 1. Install apt-cacher {{{ sudo apt-get install apt-cacher }}} 1. Enable apt-cacher Edit /etc/default/apt-cacher and change autostart to 1 1. Test apt-cacher by pointing your web browser to http://server:3142/apt-cacher to verify that it's running. (In Jaunty use http://server:3142 ; older distributions may use http://server/apt-cacher instead) = Server Configuration = 1. Edit /etc/apt-cacher/apt-cacher.conf Uncomment the following line: {{{allowed_hosts = *}}} Or set allowed_hosts to something appropriate. ''Apt Cacher now uses IPv6 addressing so you may find you need something like: allowed_hosts=::ffff:192.168.0.1/24, for example, if you want to restrict hosts to a common home subnet. 1. Change the admin_email email address to something meaningful. 1. Restart apt-cacher: {{{ sudo service apt-cacher restart }}} == Import existing cached Packages == Import any existing packages into the cache by creating symlinks: {{{ sudo /usr/share/apt-cacher/apt-cacher-import.pl -l /var/cache/apt/archives }}} == Load Packages on Server from CD == Around upgrade time, you may find it useful to get the CD image instead of using the slow update servers, and populate your cache using that. 1. Download your CD image(s) of choice. 1. Mount the CD image on the server running apt-cacher : {{{ sudo mount -o loop /home/username_or_other_path/ubuntu---.iso /media/cdrom0 }}} 1 . Run the import on the CD image, you need the -R is needed to recurse into the CD directory structure, the -r just makes sure they are copied to the cache instead of trying to link: {{{ sudo /usr/share/apt-cacher/apt-cacher-import.pl -R -r /media/cdrom0 }}} You should see the script saying that it is importing a lot of packages. == Configure a node (client or server) to run through the cache == In a terminal, type: 1. {{{ sudo nano /etc/apt/apt.conf.d/01proxy }}} 1. Inside your new file, add a line that says: {{{ Acquire::http::Proxy "http://:3142"; }}} 1. Save the file and then on the server run {{{ apt-get update }}} 1. If that succeeds without errors then update your node with {{{ apt-get dist-upgrade }}} ---- CategoryPackageManagement CategoryPackageManagement