Skip to content

Instantly share code, notes, and snippets.

@cPLevey
Created August 9, 2016 04:26
Show Gist options
  • Save cPLevey/3fa3d5e90a39ee3b2284e7210d2617de to your computer and use it in GitHub Desktop.
Save cPLevey/3fa3d5e90a39ee3b2284e7210d2617de to your computer and use it in GitHub Desktop.
#!/bin/sh
mkdir -p /var/lib/rpm/corrupt.dbs;
find /var/lib/rpm/ -maxdepth 1 -type f -name '__db.*' -exec mv {} /var/lib/rpm/corrupt.dbs/ \;
echo "Moved corrupt dbs. Rebuilding dbs now.";
rpm --rebuilddb;
echo "Complete."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment