Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

suboption/variant:

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:

#!/bin/bash
# test if ip-forward is up - if not, enable it:
#
# 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 192.168.32.8 up 
#
# Tell the kernel to do ip-forwarding:
#
ipf=$(cat /proc/sys/net/ipv4/ip_forward)
if [[ ipf -eq "0" ]] ; then 
    echo "1" > /proc/sys/net/ipv4/ip_forward
fi
#
# 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.

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
#
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
#
iptables -A FORWARD -p tcp --tcp-flags SYN,RST, SYN -j TCPMSS --clamp-mss-to-pmtu

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 192.168.32.8 

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.

conclusion:

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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.