I was trying to fix a setup issue related to airflow and accidentally I removed
python3-dateutil from the machine (RHEL 8) using
sudo yum remove python3-dateutil this also lead to the removal of dependant packages like
yum-utils and some various other unused dependencies like
usermode and etc.
Now when I am trying to reinstall
sudo yum install python3-dateutil, it’s giving Error: There are no enabled repositories in “/etc/yum.repos.d”, “/etc/yum/repos.d”, “/etc/distro.repos.d”. None of the yum command is working.
Someone how knows how to fix this issue kindly help.
A very similar question was asked in the post
CentOS 8 – uninstalled python, How to recover laptop?
The answer that was given is as follows:
You could revert the last transaction with:
dnf history undo last
Since you already ran something else, reverting last won’t restore to
the desired state. List the last 5 transactions:
dnf history list | head -n5
Then rollback to the one prior to the ID that corresponds to when
you mistakenly deleted Python, e.g.:
dnf history rollback 123
123should be a transaction that was before you deleted
Python, aka “last good transaction”.
- List the packages you uninstalled using
dnf history info <num>
- Open to the Red Hat Package Browser. And choose your product in the drop-down menu. For me, it is “Red Hat Enterprise Linux for x86_64“.
- Search for every package one by one and click “noarch” or “x86_64” depending on your architecture and package availability.
- Select the version in the drop-down menu that corresponds to the version you listed in step 1.
- Download the package (Not the one marked source)
- Send the RPMs to your server/workstation
sudo dnf localinstall *.rpm