How to setup APT-Cacher – Avoid ‘redundancy :) ‘ in updates

Its been long since I wrote something abt Ubuntu…here’s one for today:

Today we faced a new issue : We had two Ubuntu Hardy 32-bit and one 64-bit and each of us were updating it independently until we setup this cutey “apt-cacher”.This is what it Does : A particular package gets downloaded from the net only once though any comp. may have requested it. By this method, the repository gets maintained in a single computer and all others can transfer from it locally (if the package is available) or download from the net (a copy is maintained in the local repository).

How to Setup apt-cacher with minimum configuration issues :

Host Machine (where the repository is going to be maintained) :

  1. Use synaptic or type $sudo apt-get install apt-cacher in the terminal to install apt-cacher.
  2. The /etc/apt-cacher/apt-cacher.conf lets you tweak its settings.
  3. The default port is 3142 which needs no change unless you use it for someother purpose.The “allowed_hosts” variable allows you to modify which all local IPs can connect to the local repo.By default all of the local network can access it and so “allowed_hosts=*”

    “path_map” is the variable where you can setup aliases for the URLs incase (ease if you are planning on a larger scale use)

    Set apt-cacher to autostart by setting “AUTOSTART=1” in /etc/default/apt-cacher

    Restart the apt-cacher service : $ /etc/init.d/apt-cacher restart

In the client machines :

  • Easy method when you have not defined any path-maps :
  • $ sudo cp /etc/apt/sources.list /etc/apt/sources.list.back

    $ sudo gedit /etc/apt/sources.list

    and replace all “http://” with “http://ip-address-of-the-repo-machine:3142/“. So typically “….”  would now look like       “…”

    Then, take a backup of this modified file (easy to restore in case you change by to internet server accidentally)

    $ sudo cp /etc/apt/sources.list /etc/apt/sources.list.newconf

  • If you have defined path_maps, change accordingly, save and quit.

Now your own apt-cacher is setup and your friends and such can use your if they have problem accessing the net.

Theres also a program called apt-mirror which sync the whole ubuntu repo with ur local repo archive. If any of ya in Coimbatore have an ultra-fast, unlimited broadband connection do try this and pass it on to me pl 🙂 .


~ by toolweb on July 6, 2008.

One Response to “How to setup APT-Cacher – Avoid ‘redundancy :) ‘ in updates”

  1. […] Debian/Ubuntu Set up Apt-cacher on a server so clients can retrieve updates and programs from the se… page_revision: 0, last_edited: 1240653988|%e %b %Y, %H:%M %Z (%O ago) edittags history files print site tools+ options edit sections append backlinks view source parent block rename delete help | terms of service | privacy | report a bug | flag as objectionable Hosted by — get your free wiki now! Unless stated otherwise Content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License Click here to edit contents of this page. Click here to toggle editing of individual sections of the page (if possible). Watch headings for an “edit” link when available. Append content without editing the whole page source. Check out how this page has evolved in the past. If you want to discuss contents of this page – this is the easiest way to do it. View and manage file attachments for this page. A few useful tools to manage this Site. See pages that link to and include this page. Change the name (also URL address, possibly the category) of the page. View wiki source for this page without editing. View/set parent page (used for creating breadcrumbs and structured layout). Notify administrators if there is objectionable content in this page. Something does not work as expected? Find out what you can do. General documentation and help section. Terms of Service – what you can, what you should not etc. Privacy Policy. _uff = false; _uacct = “UA-68540-5″; _udn=””; urchinTracker(); _qoptions={ qacct:”p-edL3gsnUjJzw-” }; […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: