CentOS 8: No URLs in mirrorlist error

If you use CentOS 8, you might have noticed that starting from January 31, 2022, installing packges with yum no longer works with an error No URLs in mirrorlist, similar to the following:

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

The same issue could hit you if you use Docker container images based on centos:8

What is the reason behind this? Why did everything work fine just yesterday? This short article explains the reason of the error and how to solve it.

On January 31, 2022, CentOS team has finally removed all packages for CentOS 8 from the official mirrors. CentOS 8 has reached its end-of-life on December 31, 2021, but the packages were kept on the official mirrors for a while. Now they’re moved to https://vault.centos.org

The proper way of handling the issue would be to migrate to CentOS Stream 8. But what if you can’t afford this? Here’s a solution that worked for me.

If you still need to run your old CentOS 8, you can update the repos in /etc/yum.repos.d to use vault.centos.org instead of mirror.centos.org . Here are two simple commands to do this, both need to be run with sudo:

They essentially replace the base URL with the one that’s still functioning. This should solve the issue for a while, but keep in mind that you won’t receive any updates for CentOS 8 anymore. In the long run, try to upgrade to the Stream version.

This solution worked for me. I hope this short article helped to resolve the issue for you too.

Update: if you face an “Error setting up base repository” error during CentOS 8 installation, it’s related to the same problem, and can be fixed as described in my follow-up article.

--

--

--

Technical project lead @ CRX Markets. I mostly write about Java and microservice architecture. Occasional rants on software development in general.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Empathy can make a difference in your development team

Deploying Lambda Functions with Layer using CDK

Day 34 Training at Ryaz: Skriper task completed

Load testing and performance improvement of Java Application — Step by Step Guide — Part 1

On Agile Hardware Development

How to configure CORS in Spring Boot

Improve Operations With Salesforce Dynamics GP Integration — AppShark

Running cron jobs on AWS Lambda with Scheduled Events

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sergei

Sergei

Technical project lead @ CRX Markets. I mostly write about Java and microservice architecture. Occasional rants on software development in general.

More from Medium

CentOS 8 installation: Error setting up base repository

How to Make Docker Containers Talk to Each Other

Why and how to start to learn Docker

Docker in Windows 11 using WSL2