From the server you can announce to the network there is an apt-cacher-ng instance through avahi
From the client you can check if exist an apt-cacher-ng service and modify apt proxy settings accordly.
Server
Install
$ sudo apt-get install apt-cacher-ng squid-deb-proxy-client
For Ubuntu releases older than 14.04 put the following snippet in /etc/avahi/services/apt-cacher-ng.service:
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">apt-cacher-ng proxy on %h</name>
<service protocol="ipv4">
<type>_apt_proxy._tcp</type>
<port>3142</port>
</service>
</service-group>
Client
Install
$ sudo apt-get install squid-deb-proxy-client
Here is a snippet to install server|client depending if there is already an apt-get proxy or not:
Source: http://blog.surgut.co.uk/2013/03/avahi-apt-cacher-ng-sbuild.html