#!/bin/bash
# Download source from repositories
# enabled on this system.

echo "To get source for installed applications, press [ENTER] to execute..."
read line

mkdir source
cd source
dpkg --get-selections | while read line
do
        package=`echo $line | awk \'{print $1}\'`
        mkdir $package
        cd $package
        apt-get -q source $package
        cd ..
done
