Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 20 lines (14 sloc) 672 Bytes
#!/usr/bin/env bash
dpkg --get-selections > "/tmp/installedPackages.txt"
while read -r pkg status; do
if [[ "${status}" == "install" ]]; then
pkgAdd+=" ${pkg}"
else
pkgRm+=" ${pkg}"
fi
done < "/tmp/installedPackages.txt"
rm "/tmp/installedPackages.txt"
printf '#!/usr/bin/env bash\n\napt-get install %s' "${pkgAdd}" > "/tmp/installPackages"
printf '#!/usr/bin/env bash\n\napt-get install %s' "${pkgRm}" > "/tmp/removePackages"
printf '%s\n\n%s\n\n' "A shell script to install the packages can be found at:" " /tmp/installPackages"
printf '%s\n\n%s\n\n' "A shell script to remove the packages can be found at:" " /tmp/removePackages"