Problem updating with yum using subscription-manager

Latest response

I am getting this yum update error after successfully registering my system:

[root@themoon yum.repos.d]# yum update
Loaded plugins: fastestmirror, langpacks, product-id, subscription-manager
foreman-plugins | 2.9 kB 00:00:00
mysql-connectors-community | 2.5 kB 00:00:00
mysql-tools-community | 2.5 kB 00:00:00
mysql56-community | 2.5 kB 00:00:00
puppetlabs-deps | 2.5 kB 00:00:00
puppetlabs-pepackages | 2.5 kB 00:00:00
puppetlabs-products | 2.5 kB 00:00:00
https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.

One of the configured repositories failed (Red Hat Enterprise Linux 7 Server (RPMs)),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Disable the repository, so yum won't use it by default. Yum will then
    just ignore the repository until you permanently enable it again or use
    --enablerepo for temporary usage:

        yum-config-manager --disable rhel-7-server-rpms

 4. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=rhel-7-server-rpms.skip_if_unavailable=true

failure: repodata/repomd.xml from rhel-7-server-rpms: [Errno 256] No more mirrors to try.
https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

[root@themoon yum.repos.d]# subscription-manager list --available --all
+-------------------------------------------+
Available Subscriptions
+-------------------------------------------+
Subscription Name: Red Hat Enterprise Linux Server Entry Level, Self-support
Provides: Red Hat Beta
Oracle Java (for RHEL Server)
Red Hat Enterprise Linux Server
SKU: RHXXXXXXX
Contract: XXXXXXXX
Pool ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Provides Management: No
Available: 12
Suggested: 0
Service Level: Self-Support
Service Type: L1-L3
Subscription Type: Instance Based
Ends: 17/06/18
System Type: Physical

Got any ideas anyone?

Responses

What does
subscription-manager release --show

give you? Are there any values in /etc/yum/vars? It apeears that something is causing the releasver variable to not be set.

Thanks, after setting release version, issue is fixed

Thanks for the reply.

[root@themoon var]# subscription-manager release --show
Release not set
[root@themoon var]# ls /etc/yum/vars
[root@themoon var]#

How do I set the releasever?

At one stage I did comment out the basarch and releasever in /etc/yum.conf
[root@themoon var]# cat /etc/yum.conf
[main]
basearch=x86_64
releasever=7
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

But I've restored it and yum still has problems:
[root@themoon var]# yum update
Loaded plugins: fastestmirror, langpacks, product-id, subscription-manager
foreman-plugins | 2.9 kB 00:00:00
mysql-connectors-community | 2.5 kB 00:00:00
mysql-tools-community | 2.5 kB 00:00:00
mysql56-community | 2.5 kB 00:00:00
puppetlabs-deps | 2.5 kB 00:00:00
puppetlabs-pepackages | 2.5 kB 00:00:00
puppetlabs-products | 2.5 kB 00:00:00
https://cdn.redhat.com/content/dist/rhel/server/7/%24releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.

One of the configured repositories failed (Red Hat Enterprise Linux 7 Server (RPMs)),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Disable the repository, so yum won't use it by default. Yum will then
    just ignore the repository until you permanently enable it again or use
    --enablerepo for temporary usage:

        yum-config-manager --disable rhel-7-server-rpms

 4. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=rhel-7-server-rpms.skip_if_unavailable=true

failure: repodata/repomd.xml from rhel-7-server-rpms: [Errno 256] No more mirrors to try.
https://cdn.redhat.com/content/dist/rhel/server/7/$releasever/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
[root@themoon var]#

OK, I've found a way to set the releasever, but the path now does not seem correct:

[root@themoon yum.repos.d]# echo 7 > /etc/yum/vars/releasever
[root@themoon yum.repos.d]# yum update
Loaded plugins: fastestmirror, langpacks, product-id, subscription-manager
foreman-plugins | 2.9 kB 00:00:00
mysql-connectors-community | 2.5 kB 00:00:00
mysql-tools-community | 2.5 kB 00:00:00
mysql56-community | 2.5 kB 00:00:00
puppetlabs-deps | 2.5 kB 00:00:00
puppetlabs-pepackages | 2.5 kB 00:00:00
puppetlabs-products | 2.5 kB 00:00:00
https://cdn.redhat.com/content/dist/rhel/server/7/7/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.

One of the configured repositories failed (Red Hat Enterprise Linux 7 Server (RPMs)),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Disable the repository, so yum won't use it by default. Yum will then
    just ignore the repository until you permanently enable it again or use
    --enablerepo for temporary usage:

        yum-config-manager --disable rhel-7-server-rpms

 4. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=rhel-7-server-rpms.skip_if_unavailable=true

failure: repodata/repomd.xml from rhel-7-server-rpms: [Errno 256] No more mirrors to try.
https://cdn.redhat.com/content/dist/rhel/server/7/7/x86_64/os/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
[root@themoon yum.repos.d]#

The baseurl just looks wrong! Apart from in the redhat.repo file, where is the baseurl set. Each time I edit the baseurl in redhat.repo, it resets with a 'yum update' :(

Shouldn't the distroverpkg=centos-release be distroverpkg=redhat-release instead?

Thanks for your help everyone. Yes, at one point this system was joined to a CentOS 7 repo, so by removing the two lines:

bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release

seems to have fix this - I mean have fixed this. Of course there were loads of CentOS packages that needed removing and fixing, but I am now onto fixing yum! How do I do this?

[root@themoon ~]# yum list |grep yum
yum.noarch 3.4.3-125.el7.centos @local
yum-langpacks.noarch 0.4.2-3.el7 @anaconda/7.1
yum-metadata-parser.x86_64 1.1.4-10.el7 @anaconda/7.1
yum-plugin-fastestmirror.noarch 1.1.31-29.el7 @local
yum-rhn-plugin.noarch 2.0.1-5.el7 @anaconda/7.1
yum-utils.noarch 1.1.31-29.el7 @anaconda/7.1
PackageKit-yum.x86_64 0.8.9-11.el7 rhel-7-server-rpms
kabi-yum-plugins.noarch 1.0-3.el7 rhel-7-server-rpms
yum-plugin-aliases.noarch 1.1.31-29.el7 local
yum-plugin-changelog.noarch 1.1.31-29.el7 local
yum-plugin-tmprepo.noarch 1.1.31-29.el7 local
yum-plugin-verify.noarch 1.1.31-29.el7 local
yum-plugin-versionlock.noarch 1.1.31-29.el7 local

How do I remove yum(centos) and install the redhat version?

Got it:

yum downgrade yum
yum upgrade

All fixed thanks for your help :)

By the way, I joined my physical server and it seems to consume 2 subscriptions... Is this right? The system has only one CPU with 2 cores. It is a Dell PowerEdge R320. Is it supposed to consume two subscription licenses?

cpu.core(s)_per_socket 12
cpu.cpu(s) 24
cpu.cpu_socket(s) 1
cpu.thread(s)_per_core 2
cpu.topology_source kernel /sys cpu sibling lists
distribution.id Maipo
distribution.name Red Hat Enterprise Linux Server
distribution.version 7.1
distribution.version.modifier ga
dmi.baseboard.manufacturer Dell Inc.

I have tried all the solutions up there there and still I see the same error : I am using : - RedHat Enterprise Linux 7.0 registered auto attached. - Virtualization Platform (type of installation). my yum.conf file looks as following :

cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Disable the repository, so yum won't use it by default. Yum will then
    just ignore the repository until you permanently enable it again or use
    --enablerepo for temporary usage:

        yum-config-manager --disable rhel-7-server-rpms

 4. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=rhel-7-server-rpms.skip_if_unavailable=true

When I used the GUI installation I do not have any problem. Can someone please advice or provide a link to real solution, Thanks .

I have been able to fix the issue by defining the variable explicitly

echo 7Server > /etc/yum/vars/releasever

Hi Maaz,

Great hint.

Regards,

Jan Gerrit

yum clean all rm -rf /var/cache/yum/* yum repolist yum update -- > successful without any issues

Hi Maaz, it work for me. thanks. -yazid

Your solution worked with me! Thanks!

Commenting out the following in the yum.conf file correct this error for me on RHEL6.8 ... bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum distroverpkg=centos-release ...

Thanks for the tips.

I have tried all the above steps as mentioned : $subscription-manager release --show Release: 7.6 And then performed these steps yum clean all yum repolist yum list

But the problem below still appears. I am not using a proxy for my connection. Please help.

https://download.postgresql.org/pub/repos/yum/testing/12/redhat/rhel--x86_64/repodata/repomd.xml: [Errno 14] curl#77 - "Problem with the SSL CA cert (path? access rights?)"

Hi Uma,

That looks to be a temporary problem over there. Please execute these commands and test if that helps you:

# subscription-manager remove --all
# subscription-manager unregister
# subscription-manager clean
# subscription-manager register
# yum clean all
# rm -rf /var/cache/yum/*
# yum repolist

If the problem persists then it is better that you trigger a new thread and record the issue with all the steps that you've already tried so that community could help you better.. All the best!

This system is registered to Red Hat Subscription Management, but is not receiving updates. You can use subscription-manager to assign subscriptions. RHEL 8 - RPMforge.net - dag 4.3 B/s | 169 B 00:39
Error: Failed to synchronize cache for repo 'rpmforge'

Hi Seun,

Please remove the RPM Forge repository ... it is dead ... hence the error ! :)

Regards,
Christian

I ran into the same issue, with one noted exception. I used echo 7Workstation > /etc/yum/vars/releasever as a valid workaround for those using 7.5. Workstation. Worked like a charm.

Thanks for this information, Adam ! :)