DNF failure 404 getting dnf extras Rocky 9 x86_64

Good morning awesome people !

I am getting a 404 downloading extras on Rocky 9 x86_64. The relevant bits are below. Any advice is well appreciated. THe google searches done so far in re changes to dnf.conf or yum repos did not resolve.

Command example:
[vizteksupport@cntv501exadb01 ~]$ sudo dnf -y install sysstat
Rocky Linux 9 - Extras 191 B/s | 146 B 00:00
Errors during downloading metadata for repository ‘extras’:

Thank yoU!

DNF side:
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False
baseurl=https://download.fedoraproject.org/$contentdir/$releasever/BaseOS/$basearch/os

That URL contains string “vault”, which probably should not be there. Wrong URL.

First, dnf.conf is not likely to have any URL.
Second, this one points to fedoraproject.org, and “BaseOS” within, so is not related.

Perhaps dnf repolist (or dnf repolist all) tells more about what you have.
Also, grep -r extras /etc/yum.repos.d should (in coarse manner) list repo definition files of interest.

[vizteksupport@cntv501exadb01 ~]$ dnf repolist all | grep extra
extras Rocky Linux 9 - Extras enabled

[vizteksupport@cntv501exadb01 ~]$ grep -r extras /etc/yum.repos.d
/etc/yum.repos.d/rocky-extras.repo:# rocky-extras.repo
/etc/yum.repos.d/rocky-extras.repo:[extras]
/etc/yum.repos.d/rocky-extras.repo:#mirrorlist=Home - Mirror Manager
/etc/yum.repos.d/rocky-extras.repo:baseurl=http://dl.rockylinux.org/vault/rocky/$releasever/extras/$basearch/os/

Trimmed as the system doesn’t allow more than two links…

A check of http://dl.rockylinux.org/vault/rocky/9/extras/x86_64/os/ shows an nginx 404.

Choose one of the correct versions here: Index of /vault/rocky/ since it’s either 9.0, 9.1, 9.2 or 9.3. The value on it’s own is most likely what you have from the main mirrors which assume the latest release hence why on the vault you have to be more specific.

Although in all honesty, why are you trying to use the vault when it would be better using the live mirrors.

@iwalker Note the:

#mirrorlist=...
baseurl=...

Perhaps s/vault/pub/ since http://dl.rockylinux.org/pub/rocky/9/extras/x86_64/os/ exists.

There is no such thing as vault/rocky/9 and there never will be. Why are you trying to use the vault? You are recommended to use pub/rocky/9 or the mirror lists to always have the most up to date packages.

It may be worth looking into why the $releasever expands to 9 and not 9.3 then. How can I change it?

The better question is why are you trying to use the vault? The repodata is not available for 9.3 in the vault yet and will not be available until we release 9.4. What exactly are you trying to accomplish?

I just want to install sysstat. If there is a superior way to do this than the following command, please advise.

dnf install sysstat

If you insist:

sed --in-place=mybk '{s/^#mirrorlist/mirrorlist/; s/^baseurl/#baseurl/; s/vault/pub/;}' /etc/yum.repos.d/rocky-extras.repo
dnf --enablerepo=* clean all
dnf install sysstat

But check out what the ‘sed’ would do before you use it.

Rocky Linux 9 - Extras 116 kB/s | 22 kB 00:00
Errors during downloading metadata for repository ‘extras’:

  • Curl error (3): URL using bad/illegal format or missing URL for />/repodata/repomd.xml

File contents now look like:
[extras]
name=Rocky Linux $releasever - Extras
mirrorlist=Home - Mirror Manager

Something wrong with the URL. It is possible to revert to the baseurl:

sed --in-place=mybk2 '{s/^mirrorlist/#mirrorlist/; s/^#baseurl/baseurl/; }' /etc/yum.repos.d/rocky-extras.repo

Which should be ok now that there is no “vault” in it. However, I would check what

dnf --disablerepo=extras reinstall rocky-repos

says that it would do. If it just that package, then let it do what it does.

That should store the ‘rocky-extras.repo’ from package as
/etc/yum.repos.d/rocky-extras.repo.rpmnew (since the current file is modified).
Then one can replace the “bad copy”:

mv /etc/yum.repos.d/rocky-extras.repo.rpmnew /etc/yum.repos.d/rocky-extras.repo

This worked now but is not clear why.

The final [extras] block reads:

[extras]
name=Rocky Linux $releasever - Extras
mirrorlist=https://mirrors.rockylinux.org/#mirrorlist?arch=$basearch&repo=extras-$releasever$rltype
gpgcheck=1
enabled=1
countme=1
metadata_expire=6h

I did put the block in your post into “code tags” to show the verbatim strings.

The repo definition was modified and there could have been “odd characters” that we did not spot. The fresh copy has cleared that issue.