Here is how I managed to solve this.
To simplify I execute here everything as root (note - this is unsafe). Better use "sudo".
[internet] - [hostA] - [hostB]
On hostA (the one with access to internet):
1. Execute following command:
Code:
# ssh -R 1111:mirrordirector.raspbian.org:80 -R 2222:archive.raspberrypi.org:80 -R 1443:archive.raspberrypi.org:443 -R 1080:raspbian.mirror.garr.it:80 pi@hostB
NOTE: you may need to change host
raspbian.mirror.garr.it (depending from you location on the world). You will figure it out when you execute: apt install "package" - will drop error that cannot resolve specific host name. Take the host name from the error and replace it with the one from my example:
raspbian.mirror.garr.it
On hostB (Raspbian):
2. backup and then edit following files (full file content shown here):
Code:
# cp -a /etc/apt/sources.list /etc/apt/sources.list.orig
# cp -a /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.orig
/etc/apt/sources.list
deb http://localhost:1111/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
/etc/apt/sources.list.d/raspi.list
deb http://localhost:2222/debian/ jessie main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ jessie main ui
3. Add following entry to
/etc/hosts. NOTE for:
raspbian.mirror.garr.it which might be different depending from your location in the world.
Code:
127.0.0.1 localhost www.raspberrypi.org raspbian.mirror.garr.it
4. Forward port: 80 and 443 to already existing tunnel - initiated in the 1st stop
Code:
ssh -f -C -q -N -L 80:127.0.0.1:1080 pi@127.0.0.1
ssh -f -C -q -N -L 443:127.0.0.1:1443 pi@127.0.0.1
5. Execute apt commands
Code:
apt-get update (some errors expexted)
apt-gat install "package"