Package Proxy Cache

From ArchWiki
Revision as of 17:43, 23 May 2010 by Oskude (talk | contribs) (Introduction)
Jump to: navigation, search


if you want to install the same arch packages over and over - like for testing AIF profiles - it could help if you wouldnt have to get the packages everytime from the internet. this arcticle shows you how to setup a Squid proxy that only caches arch packages and can be used with aif/pacman/wget/etc with minimal configuration on the client system.

Note: this document is still under testing!

Install Squid


Configure Squid

this is the minimum configuration to get squid cache arch packages.

Cache Rules

before defining these rules, remove/comment (if you dont need them) all the default refresh_patterns Template:File that should define that *.pkg.tar.* gets cached, and anything else should not

Maximum Filesize

Objects larger than this size will NOT be saved on disk Template:File

Cache Directory

Set the cache dir and its maximum size and subdirs Template:File


everytime (and after fresh install) when you change the cache_dir path, you need to (re)create this directory Template:Cli and it could be helpful to check the config file before running Template:Cli

Start Squid

Template:Cli or if squid is already running Template:Cli


it could be helpful to check the config file before running Template:Cli

Follow Squid Access

to see the acces to squid Template:Cli you should see this for packages that are directed to original host Template:Cli and for packages that are delirever from the cache Template:Cli

Manual Arch Install

before running /arch/setup, add variables for your proxy. to do so, run on the console Template:Cli

now just use /arch/setup to normally install the system, and it should use your proxy. watch the squid logs to verify this.

Note: if you want to use the proxy in the installed system, you need to add the http_proxy and/or ftp_proxy variables in an appropiate place.

Automatic Arch Install

After login in the arch install image, setup your network (eg. `dhcpcd eth0`) and get this AIF profile on it.

Warning: This PARTITIONS AND FORMATS the defined device, so please go through the whole file before you run it!

Template:File and install the system according to that profile Template:Cli now sit back, and enjoy the automation :)

Tip: watch the squid logs, specially that on the second run you get TCP_HIT and NONE

and after the setup is done, the installed system should use your proxy for pacman/wget/etc.