Take the 2-minute tour ×

I have a network of 20 computers (all running Ubuntu 10.04 LTS), connected together in a network. Most of the machines are placed in places that are really hard to get to.

I have a central machine from which I can freely ssh to all other machines. this central machine is the only one that is connected to the internet.

I now have a need to install Java 1.6 on all the 'remote' machines (those that are not connected to the internet).

Would it be possible to do so by accessing them from within the 'central' machine, and providing them with the Java 1.6 installation files (or in some other way?) how do I go about it?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

download zip

You can always downsload an archived JDK from oracle. This can be moved to an appropriate position, and extracted there.

Java doesn't need much setup. Setting JAVA_HOME in in a profile file is a good idea, and putting the JDK/bin - dir into the path. However ...

  • If there is already an OpenJDK installed, or Java-1.5, it can be more complicated. There are often a lot of links in /etc/alternatives for Java - check that out.

central machine as repository

I don't know if it is possible to use the central pc as a proxy. to install the JDK there, and tell the other machines to use it as source. Keywords for a search: repository, apt-get, proxy.


Copy the so downloaded .dep-files to the clients, and use dpkg -i xy.deb to install it.

Network vodoo

You can use a few commands, put into a script, to use the central machine as router, to visit the internet from the clients. You need 2 commands on the clients too. Then you could use apt-get from the clients to access the internet.

I don't understand these scripts myself - only in sofar, to adopt it to my needs. :) This is my 'gateway.sh' script, to be run on the router with sudo:

# maybe the network card has no IPv4 adress? Use a static IP:
# if you have a static, well known IP, comment this out:
ifconfig eth0 up 
# Tell the kernel to do ip-forwarding:
# forward-masquerade, script follows:
. /etc/ppp/masquerade
# might or might not be needed. 
# start dhcp-server, older method:
# /etc/init.d/dhcp3-server start
# newer method:
# /etc/init.d/dhcdbd start

Then you need the ip-masquerade-script, which you needn't place in /etc/ppp/masqeuerade, but change the line in gateway.sh, if you don't do so.

modprobe ip_conntrack_ftp
modprobe ip_nat_ftp

Just a few lines. Now you would start sudo gateway.sh and wait for the clients. These wouldn't do much:

 sudo route add default gw 

whatever the IP of the central machine is. This could already be sufficient. Maybe you would modify the DNS-Server, to have one of your ISPs DNS in there:

 sudo edit /etc/resolv.conf 

A running avahi-daemon and NetworkManager could interfere with the clients, mainly.


For the third and first way, I know how to do it exactly, but the most elegant way would probably be No. 2, but I never did it myself. So I would recommend to search a bit, or wait a little, maybe somebody knows how to do it, or how to do something better.

share|improve this answer
user unknown: that you for your help –  user11833 Apr 13 '11 at 2:34

You could set up an apt proxy. If you search Synaptic for apt proxy, you'll find several options. In the past, I've used either apt-cacher or apt-cacher-ng; I can't remember which.

The apt proxy should enable your "remote" machines to use apt just as if they were connected to the Internet. And, you'll only use the bandwidth to download a particular package once.

share|improve this answer

How about setting up the central machine up as an NFS server, and placing the JDK update files there- and mounting that directory on other machines on the intranet?

share|improve this answer

Your Answer


