I have a few GNU/Linux machines running Debian testing. All of them are of the same arch (amd64) so they need the same
packages. Upgrading them was always a bit painful - fetching the same packages several times, so I though about
installing some proxy for deb packages. I tried standard
squid, but somehow it did not work well for me - perhaps
I could not configure it correctly, so I tried apt-cacher-ng and
it works great!
I'd like to share here how to make this kind of proxy solution. I use it on Synology DS111 with DSM4.0.
If you want it quick I precompiled
apt-cacher-ng for DS111 and DSM 4.0 - it should work fine with
DS110j, DS210j, DS410j, DS211j, DS411j, DS211, DS411, DS211+ as well.
- Create user
apt-cacher-ngusing web interface and DON'T give him any permissions. The cacher will run as this user. The rest of this instruction assumes you did that and home directory of this user is
- Get precompiled package, upload to your diskstation.
- Then login as
apt-cacher-ng's shell to
/bin/sh. It is needed for starting script to start program as this user.
- Still being root do
su - apt-cacher-ng- you should land in his home directory. Unpack the tgz from this location. It will create you few directories: bin - with executable and starting script; etc - with configuration; cache and log - both empty;
- Create symbolic link to start script: exit back to root (just type exit) and:
ln -s /volume1/homes/apt-cacher-ng/bin/start-script.sh /opt/etc/init.d/S86apt-cacher-ng
- Check it:
/opt/etc/init.d/S86apt-cacher-ng start- it should say Starting apt-cacher-ng server: done.. Enjoy!
Not so quick - compile it yourself
Well first of all you need a toolchain for your diskstation. Check on synology webpage what you should get and fetch that.
In my case, for DS111 with DSM4.0, it was:
gcc421_glibc25_88f6281-GPL.tgz. Unpack it somewhere and set some variables
for compilation. I made a little script (env.sh) for that:
#!/bin/sh TC=PATH_TO_YOUR/arm-none-linux-gnueabi CC=$TC/bin/arm-none-linux-gnueabi-gcc CXX=$TC/bin/arm-none-linux-gnueabi-g++ LD=$TC/bin/arm-none-linux-gnueabi-ld AR=$TC/bin/arm-none-linux-gnueabi-ar RANLIB=$TC/bin/arm-none-linux-gnueabi-ranlib CFLAGS="-I$TC/include" LDFLAGS="-L$TC/lib" export CC CXX LD AR RANLIB CFLAGS LDFLAGS
Execute it like so:
Time for compilation :-), so download all sources. I used those:
./configure (ignore warning and errors);
Now you should have
libz.so*. The other files zlib could complain about are not important here.
Remember this location: export ZLIB_ROOT=`pwd`
In Makefile update lines like
make you should have
Remember this location: export BZIP2_ROOT=`pwd`
Apply this patch. It will modify the
CMakeLists.txt. I must confess here
(feeling a bit ashamed ;-)): it is not the best way of doing it. What I did in this cmake file is pretty ugly - see for
yourself. However I worked for me :-) and it was possible to compile the program with previously compiled
libraries (just type
make and you will find binary in build directory). Finally strip the binary, for me it was:
Now you can fetch the precompiled package from "Quick version", replace binary with your own and follow the rest of the instructions.
I hope this description can save you some time and make your diskstation even more useful. :-)