June 30, 2020

[Note] restore apt-get remove'd package

From https://serverfault.com/questions/380856/how-to-undo-apt-get-remove


echo '#!/bin/bash' > restore
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

No comments: