Re: List available packages in a repo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patrick O'Callaghan wrote:
> On Thu, 2025-06-05 at 19:48 -0400, Todd Zullinger wrote:
>> Essentially, the list command behaves as though '--installed
>> --available' are passed if neither are given. 
>> 
> 
> Well, no. If "--available" is given explicitly, it *excludes* the
> installed packages except those from the specified repo. The behaviour
> is different if "--available" is omitted.

I was speaking of 'dnf list' without any --repo option.
When you run it without options, it shows you installed and
available packages.  But I didn't make that very clear.

The case could be made that --repo implies --available.
That would probably work as people expect in most cases, but
I could be wrong.

For --installed, there are a good number of ways that the
dnf db lacks the the originating repo of a given pacakge.

(The switch from dnf4 to dnf5 results in all of the packages
showing "unknown" until they've been later updated by dnf5.
But any dnf or rpm install commands directly on rpm files
will have a similar issue.)

Implying --installed would likely expose those and lead to
more subtle surprises.

I don't know if such a change (implying --available when
--repo is given, that is) would be confusingly different
enough from dnf list without the --repo option or not.

It's possible that since --repo is new in dnf5 that the
authors will see this as a simple bug and change it so that
it does filter as you'd expect from reading the description
of the option in dnf5-list(8).  The baggage of how yum and
dnf handled the list option previously might be avoided in
this case, which could be nice.

It may also be worth mentioning that 'dnf repoquery' often
ends up being the better tool for making these kinds of
queries.  It has more options to tune the bahvior, so its
quite possible that many folks don't spend a lot of time
thinking about how 'dnf list' has some "odd" behavior when
it comes to repo filtering.

    $ dnf -qq rq --repo=fedora | wc -l
    76879

    $ dnf -qq rq --repo=updates | wc -l
    14373

    $ dnf -qq rq --qf '%{repoid} %{full_nevra}\n' | grep -cw '^updates'
    14373

The --queryformat (AKA --qf) option has a lot of useful
options.  There is also 'fedrq' which is a tool to query
releases of Fedora, CentOS, RHEL, Rocky, Alma, and more.

That doesn't preclude improving 'dnf list' whether in
behavior or documentation, of course.  It merely offers a
few other tools in the toolbox to arrive at a similar end
state.

>> If anything, maybe the documentation for the list command
>> can be improved to make it clearer how things behave.
> 
> That's probably the most sensible course.

The "funny" part would be if you tried to do that and then
found a note in there already which does cover this.  Then
the problem becomes "how to better organize the large amount
of documentation so that note is easier to find." :)

I haven't read over the dnf5 documentation from start to
finish, so it's entirely possible I missed it.  That's one
of the problems with knowing a tool well enough to not need
the documentation most of the time (or at least thinking I
know it well enough). :/

Thanks,

-- 
Todd

Attachment: signature.asc
Description: PGP signature

-- 
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
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/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux