The system is up and running but I can't use yum or dnf and some other programs.What should I do now. How can I fix it.
You possibly have not lost the files yet; you just basically told the system to treat the files as nonexistant and that it's ok to overwrite them. You can get into the details of exactly how the files are deleted in ext3/4 here (some people should read this).
Before your system overwrites those files, you should try to use testdisk to recover the intact files. You could also just try to use the grep command as is outlined in this guide: