Errors with yum on CentOS 7 when updating server packages

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"

On July 1, 2024, CentOS 7 reached end of life, and the CentOS team has moved its repositories to the archive at vault.centos.org. Without updating the repository URLs, packages cannot be updated or validated, resulting in these errors.

Solution, run script:

/scripts/centos7_fix_repository