Permalink
Cannot retrieve contributors at this time
Fetching contributors…
| #!/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" |