Ansible installation error

Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
CentOS-8 - AppStream 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository ‘AppStream’:

I USED that os

anyone could help me fix this?

So you would like to download/update package without registering redhat subscription management?

on the tutorial there nothing regards that part and am a beginner am really confused

1 Like

I noticed that even ping command is not working then I checked for connection and it’s not connected.

@raafatadly23
In case, If you will get a message that ansible is not available after running sudo yum install ansible, then try to install epel-release first (sudo yum install epel-release).

I am facing this error too. Trying to go through the ANsible videos but can’t install ansible.

Any solutions???

please note: i am unable to register to redhart sub management as I don’t have a subscription.

how can we bypass this issue and update the mirrorlist so yum and dnf can work?

Hello, @ukez15
Did you try from pip command?
Reference docs -
Installation — Ansible Documentation

I downloaded the latest centOs and re-ran the whole process from the beginning.
The issue is resolved.

also used PIP this time

It worked with PIP??

it worked for the new installation of centOS 9

I couldn’t resolve the previous issue on centOs 8

It sounds great. Glad you resolved it by itself.
Thanks for your confirmation.

What is the exact version of centOS 8? Can you please share with me the link to download?

Here is the version: CentOS 8.2.2004

Hey, @ukez15
I tried and searched for a solution on the internet. It worked.

Switch to the root user by running the command - sudo -i
Use comment(#) to resolve below issues -

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

Then run on the terminal -

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-AppStream.repo
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-AppStream.repo

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Base.repo
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Base.repo

yum search epel-release

yum install epel-release

yum install ansible

Reference - linux - Centos through VM - no URLs in mirrorlist - Stack Overflow

Mirror list seem to have stopped working late last year for centos. instead of mirrorlist use vault, so go to /etc/yum.repos.d/ directory, you want to make changes to these file:

  1. CentOS-Linux-App*
  2. CentOS-Linux-Base*
  3. CentOS-Linux-Extra*
    comment out mirrolisturl, uncomment baseurl and change the mirrorlist word for vault like:http://mirrorlist.centos.org/… to http://vault.centos.org/

Thank you for the information, @sifuyajoe :+1: