2

I can't quite find an existing thread that suits my needs, so here goes.

We are using Raspberry Pi (RPI) as thin clients with RPITC as the OS ( It is a stripped down, modified version of Debian http://rpitc.blogspot.com ).

We would like to be able to update these RPI, however due to security reasons they are on a network that does not have internet access.

What i originally planned to do was to use apt-cacher on one of these RPI as a host which i could then move from the closed network to an open, then get the updates, which it then caches. After that i could move it back to the closed network and the other RPIs could then update via the cache on the first RPI.

It has an offline toggle which seems to be the option i need, as it says it will not use new outbound connections.

I have gotten the host to cache the updates, but when i try to update one of the clients via the host, it seems like it just tries to use it as a proxy, IE connect to the apt-get servers through the host.

All the guides i have found is more of a cache while online, so several machines can update via the local network, thus saving bandwidth.

I have tried with apt-cacher and apt-cacher-ng, where i got most success with apt-cacher, but still not what i want.

Can someone point me in the right direction as to which tool to use to have a host that i can move to an online network -> get updates -> move to offline network -> update clients via the cached updates from the host?

1 Answer 1

1

2 years late but found the non-straightforward (and explicitely not recommended in the docs) answer:

  1. apt get whatever on your cache machine - beregost.lan in this example
  2. sudo /usr/share/apt-cacher/apt-cacher-import.pl -l /var/cache/apt/archives to build symlinks to the packages into /var/cache/apt-cacher/
  3. perl -pi -e 's|http://archive.raspberrypi.org/debian/|http://beregost.lan:3142/archive.raspberrypi.org/debian/|' /etc/apt/sources.list.d/raspi.list perl -pi -e 's|http://raspbian.raspberrypi.org/raspbian/|http://beregost.lan:3142/raspbian.raspberrypi.org/raspbian/|' /etc/apt/sources.list.d/raspi.list on every raspbi host in your internal network to use beregost.lan as the mirror
  4. on beregost.lan, edit /etc/apt-cacher/apt-cacher.conf and set offline_mode = 1 then restart
  5. change permissions on /var/cache/apt/archives/ on beregost.lan to allow www-data read&write - this may be a bug in the underlying, but if it's read only the server will respond with Failed to open/create /var/cache/apt-cacher/packages/screen_4.6.2-3_armhf.deb for return: Permission denied or equivalent

beregost.lan will now be queried directly by the other hosts, and will either respond with the versions it has, or return an error.

This what you did?

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.