что-то вроде этого?
#!/bin/bash
cd /usr/local/src
if [ installation = "1" ]; then
for package in *.tar.gz
do
tar -zxvf "${package}"
done
for package in *.tar.bz2
do
tar -xvfj "$package" #it has to unpack the package
done
./configure
elif [ installation = "2" ]; then
dpkg -i "$package" #it has to install the deb package
fi