Hi,

well I don't know what's in Fedora repositories WRT nodejs, but nodejs from nodejs22 src rpm tries to be there first,
I assume the following is the correct transaction result?
~~~
$ dnf install nodejs  --disablerepo="rawhide"
Updating and loading repositories:
Repositories loaded.
Package  Arch      Version             Repository            Size
Installing:
 nodejs  noarch    3:22-1.fc44             copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin        0.0   B
Installing dependencies:
 nodejs22  x86_64    1:22.21.1-6.fc44            copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin      161.5 KiB  nodejs22-libs x86_64    1:22.21.1-6.fc44            copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin       78.1 MiB  nodejs22-npm  x86_64    1:10.9.4-1.22.21.1.6.fc44             copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin        8.8 MiB
Installing weak dependencies:
 nodejs-npm  noarch    3:22-1.fc44             copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin        0.0   B  nodejs22-docs noarch    1:22.21.1-6.fc44            copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin       97.4 MiB  nodejs22-full-i18n  x86_64    1:22.21.1-6.fc44            copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin       30.4 MiB

Transaction Summary:
 Installing:         7 packages
~~~

All repos provides:
~~~
$ dnf repoquery --whatprovides nodejs
Updating and loading repositories:
Repositories loaded.
nodejs-1:22.21.1-3.fc44.i686
nodejs-1:22.21.1-3.fc44.x86_64
nodejs-3:22-1.fc44.noarch
~~~
As to why this is happening, I have my guesses, but DNF folks can answer better.

One suggestion to try would be to try to ignore Epoch, whether the situation gets better. e.g. use ENVR for the metapackage: `1:22.21.1-8` (bumped release should do it to sort higher anyway).
If we ignore epochs, the nodejs22 is sorted higher:
~~~
$ rpmdev-vercmp 22-1.fc44 22.21.1-3.fc44
22-1.fc44 < 22.21.1-3.fc44
~~~

bumping release on left side does not help.
~~~
$ rpmdev-vercmp 22-4.fc44 22.21.1-3.fc44
22-4.fc44 < 22.21.1-3.fc44
~~~
Of course with epochs, left side (3:22) is sorted higher.

I have a suspicion this is part of the issue.
What I guess is happening is that Epoch might be getting ignored by DNF and it going in an order of Repo,
since it is in the testcase.t in this order:
~~~
repo @System -99.-1000 testtags @System.repo.gz
repo rawhide -99.-1000 testtags rawhide.repo.gz
repo fedora-cisco-openh264 -99.-1000 testtags fedora-cisco-openh264.repo.gz
repo copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin -99.-1000 testtags copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin.repo.gz
~~~

Here it's hard to even guess.
I mean how does this (line from `debugdata/packages/testcase.t` from `dnf install --debugsolver nodejs`):
~~~
job install oneof nodejs-1:22.21.1-3.fc44.i686@rawhide nodejs-1:22.21.1-3.fc44.x86_64@rawhide nodejs-3:22-1.fc44.noarch@copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin nodejs22-1:22.21.1-6.fc44.x86_64@copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin [setevr,setarch]
~~~
result in DNF preference of 1:22 when there is 3:22?

Hope it helps in pinning this down better,
Jarek

On 12/4/25 12:33 PM, Jan Stanek wrote:
Hi all,
in the process of polishing the upgrade path
for the nodejs metapackage proposal [1],
I've created a COPR [2] to ensure we can cleanly upgrade
from the current nodejs packages (that currently ship NodeJS v22.x)
to the versioned package names (nodejs22) and meta-package (nodejs) combination.
However, dnf keeps behaving differently than I would expect,
and I'm at the end of ideas of what might be wrong.

What I would expect: `dnf install nodejs` will select nodejs metapackage
for install, which pulls nodejs22 as a dependency.

What happens: `dnf install nodejs` installs nodejs22 directly.

Can any dnf/libsolv guru take a look at the COPR and spec files included
and let me know if I'm doing something obviously wrong and thus
confusing dnf, or otherwise explain what is happening?

Thanks in advance!

[1]: https://fedoraproject.org/wiki/Changes/NodeJSMetapackages
[2]: https://copr.fedorainfracloud.org/coprs/jstanek/nodejs22-bin/

---

Some logs from the current state of the COPR:

```
# dnf --repo=copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin
repoquery --whatprovides nodejs
nodejs-3:22-1.fc44.noarch

# dnf --repo=copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin
repoquery --whatobsoletes nodejs
nodejs22-1:22.21.1-6.fc44.x86_64

# dnf repoquery --whatprovides nodejs  # includes current rawhide
nodejs-1:22.21.1-3.fc44.i686
nodejs-1:22.21.1-3.fc44.x86_64
nodejs-3:22-1.fc44.noarch

# dnf install nodejs
Package             Arch   Version                   Repository
                                        Size
Installing:
  nodejs22           x86_64 1:22.21.1-6.fc44
copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin 161.5 KiB
Installing dependencies:
  c-ares             x86_64 0:1.34.5-2.fc43           rawhide
                                   269.1 KiB
  libuv              x86_64 1:1.51.0-2.fc43           rawhide
                                   570.2 KiB
  nodejs22-libs      x86_64 1:22.21.1-6.fc44
copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin  78.1 MiB
Installing weak dependencies:
  nodejs22-docs      noarch 1:22.21.1-6.fc44
copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin  97.4 MiB
  nodejs22-full-i18n x86_64 1:22.21.1-6.fc44
copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin  30.4 MiB
  nodejs22-npm       x86_64 1:10.9.4-1.22.21.1.6.fc44
copr:copr.fedorainfracloud.org:jstanek:nodejs22-bin   8.8 MiB

Transaction Summary:
  Installing:         7 packages
```
--
Jan Stanek
Software Engineer
Red Hat
IM: @jstanek


--
_______________________________________________
devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to