Skip to content

Instantly share code, notes, and snippets.

@kelsS
Created May 22, 2017 16:44
Show Gist options
  • Save kelsS/17a720e8aa807331857042cfdf49590c to your computer and use it in GitHub Desktop.
Save kelsS/17a720e8aa807331857042cfdf49590c to your computer and use it in GitHub Desktop.
Shell script that restores most recent auto removed packages.
echo '#!/bin/bash' > restore.sh
echo sudo apt-get install `grep Remove /var/log/apt/history.log | tail -1 | sed -e 's|Remove: ||g' -e 's|([^)]*)||g' -e 's|:[^ ]* ||g' -e 's|,||g'` >> restore
chmod +x restore
./restore.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment