The following error is encountered when attempting to install a package in WHM or when yum or dnf is run from the command line.
Error: Failed to download metadata for repo 'BaseOS': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
The error occurs when the "BaseOS" repository is inaccessible. The most common reason that the repo is inaccessible is because the repository was retired due to the OS being end-of-life.
Disable the "BaseOS" repository.