Using apt-get, you can easily install any package in debian/ubuntu based system. Suppose you have a list of files mentioned in a file and you want to install all those packages, you can easily do so with the help of the following shell script
#! /bin/sh
if [ $# -ne 1 ]
then echo "Usage: install.sh filename";
exit 1;
fi
if [ ! -f $1 ]
then echo "File $1 doesn't exist";
exit 1;
fi
while read line
do
pkg=`echo $line| awk '{print $1}'`
echo $pkg
yes|sudo apt-get install $pkg
done < $1
Suppose the packages to be installed is mentioned in the file libraries-php.txt
$ cat libraries-php.txt
php5-dbg - Debug symbols for PHP5
php5-dev - Files for PHP5 module development
php5-gd - GD module for php5
php5-gmp - GMP module for php5
php5-ldap - LDAP module for php5
php5-mysql - MySQL module for php5
php5-odbc - ODBC module for php5
php5-pgsql - PostgreSQL module for php5
php5-pspell - pspell module for php5
php5-recode - recode module for php5
Now let’s execute the above script
./install.sh libraries-php.txt
You will be asked password during the first package installation. Thus with the above script, you can easily specify the packages you want to install and specify the file name as argument
$ ./install.sh filename