sudo gainroot apt-get clean apt-get update dpkg -l | awk '/^ii/{ print $2 }' > apps_to_reinstall.txt apt-get install --reinstall -y --force-yes $(<apps_to_reinstall.txt)