Search code examples
linuxrepositoryrhel

How to change Repository RHEL


So, I'm trying to change my Repositorys in RHEL but I allways get the following message and have NO IDEA what it means.

Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Could not retrieve mirrorlist http://mirrors.elrepo.org/mirrors-elrepo.el6 error was
12: Timeout on http://mirrors.elrepo.org/mirrors-elrepo.el6: (28, 'connect() timed out!')
http://elrepo.org/linux/elrepo/el6/x86_64/repodata/repomd.xml: [Errno 12] Timeout on http://elrepo.org/linux/elrepo/el6/x86_64/repodata/repomd.xml: (28, 'connect() timed out!')
Trying other mirror.
http://mirrors.coreix.net/elrepo/elrepo/el6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 7 - "Failed to connect to 2a01:c0:2:3d::2: Network is unreachable"

[...]

Trying other mirror.
http://mirror.ventraip.net.au/elrepo/elrepo/el6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 7 - "Failed to connect to 2400:b800:1:1::15: Network is unreachable"
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: elrepo. Please verify its path and try again

Solution

  • You can create your own repository if you have os image.

    Mount os image at some folder say /var/rhel-repo using

    mount -o loop /path/to/os_image /var/rhel-repo
    

    create repo file in /etc/yum.repos.d/customrepo as

    [customrepo]
    name=Custom Repository
    baseurl=file:///var/customrepo
    enabled=1
    gpgcheck=0
    

    save file.Then

    yum clean all