I removed rpm and librpm4 and reinstalled them and it worked!