# limitations under the License.
 #
 
+
 function gen_arrange_script()
 {
 remotehost=$1
 COPYPROXY=$2
 
+egrep -i "Debian|Ubuntu" /etc/issue
+if [ \$? = 0 ]; then
+       INSTALLCMD="apt-get install -q --yes"
+else
+       INSTALLCMD="yum install -q -y"
+fi
+
 cat << EndArrangeScript > arrange_lb_test_root.sh 
 CERTFILE=\$1
 GLITE_USER=\$2
 
 export LBTSTCOLS
 
-yum install -q -y globus-proxy-utils 
-yum install -q -y postgresql postgresql-server
-#Standard setup now uses production brokers. No need to install our own.
-#yum install -q -y activemq java-1.6.0-openjdk
-yum install -q -y emi-lb-nagios-plugins
-yum install -q -y voms-clients
-yum install -q -y curl
-yum install -q -y wget
-yum install -q -y sudo
-yum install -q -y bc
+${INSTALLCMD} globus-proxy-utils postgresql postgresql-server emi-lb-nagios-plugins voms-clients curl wget sudo bc
 
 /etc/init.d/postgresql initdb >/dev/null 2>&1
 /etc/init.d/postgresql start
 
 if [ "\$CVSPATH" = "" ]; then
         printf "CVS binary not present"
-        egrep -i "Debian|Ubuntu" /etc/issue
-
-        if [ \$? = 0 ]; then
-                apt-get install --yes cvs
-        else
-                yum install -y cvs
-        fi
-
+       ${INSTALLCMD} cvs
 fi
 
 glite_id=\`id -u \$GLITE_USER\`
 
 done
 HTTPD_CONF=$HTTPD_CONFDIR/gridsite-webserver.conf
 
+egrep -i "Debian|Ubuntu" /etc/issue
+if [ \$? = 0 ]; then 
+        INSTALLCMD="apt-get install -q --yes"
+else
+        INSTALLCMD="yum install -q -y"
+fi
+
 cat << EndArrangeScript > arrange_gridsite_test_root.sh 
 CERTFILE=\$1
 GLITE_USER=\$2
 
 export GSTSTCOLS
 
-yum install -q -y voms-clients
-yum install -q -y httpd mod_ssl
-yum install -q -y curl wget nc lsof
+${INSTALLCMD} voms-clients httpd mod_ssl curl wget nc lsof
 
 
 sed -e '1,\$s!/usr/lib/httpd/modules/!modules/!' /usr/share/doc/gridsite-*/httpd-webserver.conf | sed 's!/var/www/html!/var/www/htdocs!' | sed "s/FULL.SERVER.NAME/\$(hostname -f)/" | sed "s/\(GridSiteGSIProxyLimit\)/# \1/"> $HTTPD_CONF
 
 if [ "\$CVSPATH" = "" ]; then
         printf "CVS binary not present"
-        egrep -i "Debian|Ubuntu" /etc/issue
-
-        if [ \$? = 0 ]; then
-                apt-get install --yes cvs
-        else
-                yum install -y cvs
-        fi
-
+       ${INSTALLCMD} cvs
 fi
 
 if [ $COPYPROXY -eq 1 ]; then