Fix for CentOS 7 Repo Due to End of Life (EOL) Mirrorlist Error

If you’re managing CentOS 7 servers, you might have encountered a frustrating issue recently: repository failures due to the server reaching its End of Life (EOL) stage. This commonly manifests with errors like:

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"

This error indicates that the default CentOS 7 repositories are no longer accessible due to the distribution’s EOL status. Fortunately, there’s a straightforward fix to get your servers back on track.

Step-by-Step Fix

Follow these steps to resolve the CentOS 7 repository issue:

  1. Comment out Mirrorlist and Update Base URL:Open a terminal session on your CentOS 7 server and run the following commands:
    sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
    sed -i 's|#\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
    

    These commands will comment out the mirrorlist URLs and update the base URLs to point to the vault.centos.org repository, which hosts CentOS archives after EOL.

  2. Run the Fix Script:Now, execute the fix script provided by Systron to automate the base repository update:
    curl -s -L https://systron.net/blog/wp-content/uploads/2024/07/centos7-repo-fix.sh | bash
    

    This script will automatically adjust the base repository URLs to use the vault.centos.org archive, ensuring that your CentOS 7 server can fetch packages and updates without encountering the mirrorlist error.

Why Vault.CentOS.org?

The vault.centos.org repository serves as an archive for older versions of CentOS after they reach EOL. It’s maintained by the CentOS community and provides a reliable source for accessing packages and updates for unsupported versions like CentOS 7.

Conclusion

By following these steps, you can effectively resolve the mirrorlist error on CentOS 7 servers affected by the EOL repository issue. This fix ensures that your systems remain secure and operational by redirecting package requests to the appropriate archive repository.

For ongoing management of CentOS servers, staying proactive about EOL dates and transitioning to supported distributions like CentOS Stream or alternatives such as CentOS 8 or AlmaLinux is recommended. You can order a Dedicated server or VPS with AlmaLinux with us.

Stay tuned for more updates and solutions to common server management issues at Systron Micronix. If you have any questions or feedback, feel free to leave a comment below. Happy server administration!

Note: Always ensure the integrity and security of scripts downloaded from the internet before executing them on your system.

How to migrate from CentOS to the latest AlmaLinux version?

Converting from CentOS 8.0 to AlmaLinux is a straightforward process thanks to the AlmaLinux Foundation’s provided tools. Below is a step-by-step guide to help you through the conversion:

Prerequisites:

  1. Backup your data: Ensure that you have backups of all important data and configurations.
  2. Update your system: Make sure your CentOS system is up-to-date.

Steps to Convert CentOS 8.x to AlmaLinux

  1. Update CentOS:
    sudo yum update -y
    sudo reboot
    
  2. Install ELevate Tool:
    The ELevate project by AlmaLinux provides tools to migrate between different RHEL-based distributions.

    sudo yum install -y https://repo.almalinux.org/almalinux/almalinux-release-latest.x86_64.rpm
    sudo yum install -y almalinux-deploy
    
    sudo yum install -y http://repo.almalinux.org/elevate/elevate-release-latest-el$(rpm --eval %rhel).noarch.rpm
  3. Run the Conversion Tool:
    Execute the conversion tool to switch your CentOS system to AlmaLinux.

    sudo almalinux-deploy
    

    This script will:

    • Update the repository configuration files to point to AlmaLinux repositories.
    • Replace CentOS-specific packages with their AlmaLinux equivalents.
    • Clean up the package manager’s cache and database.
  4. Reboot Your System:
    After the script completes, reboot your system to boot into AlmaLinux.

    sudo reboot
    
  5. Verify the Conversion:
    Once the system has rebooted, verify that the conversion was successful by checking the OS release information.

    cat /etc/redhat-release
    

    This should output something similar to:

    AlmaLinux release 8.x (Arctic Sphynx)
    
  6. Update AlmaLinux:
    Finally, update your new AlmaLinux system to ensure all packages are the latest versions.

    sudo yum update -y
    sudo reboot
    

Post-Conversion Tasks

  • Check Services: Ensure that all critical services are running correctly after the conversion.
  • Review Configuration Files: Some configuration files might need minor adjustments.
  • Test Applications: Verify that all your applications are functioning as expected on AlmaLinux.

Additional Resources

  • AlmaLinux Documentation: The official AlmaLinux documentation provides comprehensive guides and troubleshooting tips. Refer to the Almalinux migration guide here.
  • Community Support: Join the AlmaLinux community forums and mailing lists for support from other users and developers.

By following these steps, you should be able to convert your CentOS 8.x system to AlmaLinux smoothly. Enjoy,

Converting from CentOS 7 to AlmaLinux 8 involves a bit more work than converting between CentOS 8 and AlmaLinux 8 because it includes an upgrade across major versions (from 7 to 8). AlmaLinux provides the ELevate project for this purpose, which can migrate between different RHEL-based distributions and major versions.

Here’s a step-by-step guide to help you through the conversion:

Prerequisites

  1. Backup your data: Ensure that you have backups of all important data and configurations.
  2. Update your system: Make sure your CentOS 7 system is up-to-date.

Steps to Convert CentOS 7 to AlmaLinux 8

  1. Update CentOS:
    sudo yum update -y
    sudo reboot
    
  2. Install the ELevate Tool:
    The ELevate project provides tools to migrate between different RHEL-based distributions.

    sudo yum install -y https://repo.almalinux.org/almalinux/almalinux-release-latest.el7.x86_64.rpm
    sudo yum install -y elevate-release
    
  3. Install Leapp Utility:
    Leapp is the utility used by the ELevate project for upgrading between major versions.

    sudo yum install -y leapp-upgrade leapp-data-almalinux
    
  4. Review and Customize the Pre-Upgrade Report:
    Generate a pre-upgrade report to identify potential issues.

    sudo leapp preupgrade
    

    The report will be available at /var/log/leapp/leapp-report.json. Review this report and address any issues that are flagged. You might need to install additional packages or remove conflicting ones.

  5. Perform the Upgrade:
    Once the pre-upgrade issues are resolved, start the upgrade process.

    sudo leapp upgrade
    

    This process will download the necessary packages and prepare the system for the upgrade. You may need to confirm or intervene during the process, so monitor the upgrade closely.

  6. Reboot the System:
    After the upgrade preparation is complete, reboot the system to complete the upgrade process.

    sudo reboot
    

    The system will boot into the Leapp environment to perform the upgrade. This can take some time, so be patient.

  7. Post-Upgrade Steps:
    Once the upgrade is complete, your system should boot into AlmaLinux 8. Verify the upgrade by checking the OS release information.

    cat /etc/redhat-release
    

    This should output something like:

    AlmaLinux release 8.x (Arctic Sphynx)
    
  8. Update AlmaLinux:
    Finally, update your new AlmaLinux system to ensure all packages are the latest versions.

    sudo dnf update -y
    sudo reboot
    

Post-Conversion Tasks

  • Check Services: Ensure that all critical services are running correctly after the conversion.
  • Review Configuration Files: Some configuration files might need minor adjustments.
  • Test Applications: Verify that all your applications are functioning as expected on AlmaLinux.

Additional Resources

  • AlmaLinux Documentation: The official AlmaLinux documentation provides comprehensive guides and troubleshooting tips.
  • ELevate Project: Detailed information on the ELevate project can be found on the AlmaLinux website.
  • Community Support: Join the AlmaLinux community forums and mailing lists for support from other users and developers.

By following these steps, you should be able to upgrade your CentOS 7 system to AlmaLinux 8 successfully.

When you need a powerful dedicated server or vps server always consider Systron Micronix, Into the cloud and hosting space since over two decades.