dpkg -l | awk ' { print $2; } ' | tail -n +6 | sort > pkgs.txt
touch debian-app-re-installer.sh
cat > debian-app-re-installer.sh <<EOF
cat pkgs.txt >> debian-app-re-installer.sh
cat >>debian-app-re-installer.sh <<EOF
apt install --reinstall \$pkgs
chmod +x debian-app-re-installer.sh
echo "Now run (as root) ./debian-app-re-installer.sh"

All the above does is make a script, that includes the names of all the packages you have installed, and then the script sends the list to apt to reinstall them all. Just copy and paste the above into a terminal windows (as whatever user) and then run, as root: “./debian-app-re-installer.sh” after this lot: