Bug 607270 - Repo Query
Summary: Repo Query
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora Documentation
Classification: Fedora
Component: system-administrator's-guide
Version: devel
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Stephen Wadeley
QA Contact: Fedora Docs QA
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-06-23 16:42 UTC by eric
Modified: 2017-07-11 19:42 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-11 19:42:21 UTC
Embargoed:


Attachments (Terms of Use)

Description eric 2010-06-23 16:42:01 UTC
Review for possible inclusion in the SMG:

http://yum.baseurl.org/wiki/RepoQuery

http://yum.baseurl.org/wiki/Guides

Comment 1 Karsten Wade 2011-12-14 03:49:12 UTC
Removing myself for these bug components as I'm either no longer involved in that aspect of the project, or no longer care to watch this particular bug. Sorry if you are caught in a maelstrom of bug changes as a result!

Comment 2 Pete Travis 2013-06-17 17:11:44 UTC
This might fit well in the 'Package Management' section of the System Administrator's Guide', which is currently maintained. Any thoughts on reassigning this?

Comment 3 Jaromir Hradilek 2013-06-17 21:21:21 UTC
Hi Pete,

I absolutely agree that this should be documented in the System Administrator's Guide. Please, feel free to assign this bug to me.

Cheers,
Jaromir

Comment 4 Pete Travis 2013-06-18 01:49:38 UTC
Thanks Jaromir, reassigning.

Comment 5 Stephen Wadeley 2016-03-01 20:23:06 UTC
Hello


dnf has now replaced yum in Fedora. So lets see if dnf has something similar to repoquery from the Yum-utils package.


in the dnf man page I see this:

If you know the name of such a command (including commands mentioned below), you  may find/install the package which provides it using the appropriate virtual provide in the form of dnf-command(<alias>) where <alias> is the name of the command; e.g. dnf-command(repoquery) for a repo‐
query command (the same applies to specifying dependencies of packages that require a particular command).


I cannot understand that and trying various commands using dnf-command(repoquery) did not work. Lets ask the devs for some examples and maybe even a more verbose, or even just differnet. explanation.


Hello Jaroslav

Can you shed some light on the text above?

Thank you

Comment 6 Jaroslav Mracek 2016-03-02 14:16:54 UTC
Here is an example:

"dnf install 'dnf-command(repoquery)'"
it will install package that provides dnf command repoquery.

If you will type command "dnf asdas"
you will get a message:
 
No such command: asdas. Please use /usr/bin/dnf --help
It could be a DNF plugin command, try: "dnf install 'dnf-command(asdas)'"


I hope it helps

Comment 7 Jaroslav Mracek 2016-03-07 10:36:49 UTC
I made a new pull-request that could solve a misunderstanding: https://github.com/rpm-software-management/dnf/pull/457

Comment 8 Stephen Wadeley 2016-03-14 22:02:52 UTC
Thank you Jaroslav

[root@dhcp-4-151 ~]# dnf install 'dnf-command(repoquery)'
Last metadata expiration check performed 1:39:11 ago on Mon Mar 14 20:50:43 2016.
Package dnf-plugins-core-0.1.16-1.fc22.noarch is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!



If we add as section on repoquery I think we would have to add it at the end, after here:
https://docs.fedoraproject.org/en-US/Fedora/23/html/System_Administrators_Guide/sec-Managing_DNF_Repositories.html

usage: dnf repoquery [--help-cmd] [--repo REPO] [--arch ARCH] [-f FILE]
                     [--whatprovides REQ] [--whatrequires REQ]
                     [--whatrecommends REQ] [--whatenhances REQ]
                     [--whatsuggests REQ] [--whatsupplements REQ] [--alldeps]
                     [--querytags] [--resolve] [--tree] [--srpm]
                     [--latest-limit LATEST_LIMIT]
                     [-i | -l | -s | --qf QUERYFORMAT]
                     [--duplicated | --installonly | --unsatisfied]
                     [--conflicts | --enhances | --obsoletes | --provides | --recommends | --requires | --suggests | --supplements]
                     [--available | --installed | --extras | --upgrades | --unneeded | --recent]
                     [key [key ...]]

positional arguments:
  key                   the key to search for

optional arguments:
  --help-cmd            show this help about this tool
  --repo REPO           show only results from this REPO
  --arch ARCH           show only results from this ARCH
  -f FILE, --file FILE  show only results that owns FILE
  --whatprovides REQ    show only results there provides REQ
  --whatrequires REQ    show only results there require REQ
  --whatrecommends REQ  show only results that recommend REQ
  --whatenhances REQ    show only results that enhance REQ
  --whatsuggests REQ    show only results that suggest REQ
  --whatsupplements REQ
                        show only results that supplement REQ
  --alldeps             shows results that requires package provides and files
  --querytags           show available tags to use with --queryformat
  --resolve             resolve capabilities to originating package(s)
  --tree                show recursive tree for package(s)
  --srpm                operate on corresponding source RPM
  --latest-limit LATEST_LIMIT
                        show N latest packages for a given name.arch (or
                        latest but N if N is negative)
  -i, --info            show detailed information about the package
  -l, --list            show list of files in the package
  -s, --source          show package source RPM name
  --qf QUERYFORMAT, --queryformat QUERYFORMAT
                        format for displaying found packages
  --duplicated          limit the query to installed duplicated packages
  --installonly         limit the query to installed installonly packages
  --unsatisfied         limit the query to installed packages with unsatisfied
                        dependencies
  --conflicts           Display capabilities that the package conflicts with.
  --enhances            Display capabilities that the package can enhance.
  --obsoletes           Display capabilities that the package obsoletes.
  --provides            Display capabilities provided by the package.
  --recommends          Display capabilities that the package recommends.
  --requires            Display capabilities that the package depends on.
  --suggests            Display capabilities that the package suggests.
  --supplements         Display capabilities that the package can supplement.
  --available           Display only available packages.
  --installed           Display only installed packages.
  --extras              Display only packages that are not present in any of
                        available repositories.
  --upgrades            Display only packages that provide an upgrade for some
                        already installed package.
  --unneeded            Display only packages that can be removed by "dnf
                        autoremove" command.
  --recent              Display only recently edited packages

Comment 9 Stephen Wadeley 2016-03-22 06:54:39 UTC
Hello again

I am trying to find something suitable for the SysAdmin Guide. 

I tried the command `dnf repoquery --requires firewalld --tree` which gives information possible useful for debugging dependency problems. 

Then I tried these commands and wonder why ` dnf repoquery chrony --info`  does not list the repo it came from.
 
 ~]$ dnf repoquery chrony --info

Name        : chrony
Version     : 2.0
Release     : 1.fc22
Architecture: x86_64
Size        : 302076
License     : GPLv2
Source RPM  : chrony-2.0-1.fc22.src.rpm
Build Date  : 2015-04-27 12:37
Packager    : Fedora Project
URL         : http://chrony.tuxfamily.org
Summary     : An NTP client/server
Description :
A client/server for the Network Time Protocol, this program keeps your
computer's clock accurate. It was specially designed to support
systems with intermittent internet connections, but it also works well
in permanently connected environments. It can use also hardware reference
clocks, system real-time clock or manual input as time references.

Name        : chrony
Version     : 2.1.1  <--- I see change
Release     : 2.fc22
Architecture: x86_64
Size        : 295796 <--- I see change
License     : GPLv2
Source RPM  : chrony-2.1.1-2.fc22.src.rpm  <--- I see change
Build Date  : 2016-01-21 16:08  <--- I see change
Packager    : Fedora Project
URL         : http://chrony.tuxfamily.org
Summary     : An NTP client/server
Description :
A client/server for the Network Time Protocol, this program keeps your
computer's clock accurate. It was specially designed to support
systems with intermittent internet connections, but it also works well
in permanently connected environments. It can use also hardware reference
clocks, system real-time clock or manual input as time references.

Name        : chrony
Version     : 2.1.1  <--- same as previous
Release     : 2.fc22
Architecture: x86_64
Size        : 479660 <--- I see change
License     : GPLv2
Source RPM  : chrony-2.1.1-2.fc22.src.rpm <--- same as previous
Build Date  : 2016-01-21 16:08
Packager    : Fedora Project
URL         : http://chrony.tuxfamily.org
Summary     : An NTP client/server
Description :
A client/server for the Network Time Protocol, this program keeps your
computer's clock accurate. It was specially designed to support
systems with intermittent internet connections, but it also works well
in permanently connected environments. It can use also hardware reference
clocks, system real-time clock or manual input as time references.


Compare to:

 ~]$ dnf info chrony

Last metadata expiration check performed 0:13:19 ago on Sat Mar 19 10:11:13 2016.
Installed Packages
Name        : chrony
Arch        : x86_64
Epoch       : 0
Version     : 2.1.1
Release     : 2.fc22
Size        : 468 k
Repo        : @System
From repo   : updates
Summary     : An NTP client/server
URL         : http://chrony.tuxfamily.org
License     : GPLv2
Description : A client/server for the Network Time Protocol, this program keeps your
            : computer's clock accurate. It was specially designed to support
            : systems with intermittent internet connections, but it also works well
            : in permanently connected environments. It can use also hardware reference
            : clocks, system real-time clock or manual input as time references.

= = = 

These look more useful 

[sjw@dhcp-4-151 ~]$ dnf repoquery --installed chrony
chrony-0:2.1.1-2.fc22.x86_64
[sjw@dhcp-4-151 ~]$ dnf repoquery --available chrony
Last metadata expiration check performed 0:06:24 ago on Mon Mar 21 23:29:26 2016.
chrony-0:2.0-1.fc22.x86_64
chrony-0:2.1.1-2.fc22.x86_64
[sjw@dhcp-4-151 ~]$ 

[sjw@dhcp-4-151 ~]$ dnf repoquery --whatrequires chrony
Last metadata expiration check performed 0:09:15 ago on Mon Mar 21 23:29:26 2016.

anaconda-core-0:22.20.13-1.fc22.x86_64

dnf repoquery --list crony {show list of files in the package}

Comment 10 Jaroslav Mracek 2016-03-24 10:37:05 UTC
Thank you for report. We will investigate it. In future we have a plan that dnf info will be replaced by dnf repoquery and dnf info will be (maybe) only alias for dnf repoquery. Therefore please try to describe dnf repoquery approach.

Comment 11 Jaroslav Mracek 2016-03-24 10:53:39 UTC
The difference is as follows:
dnf info shows only the newest available packages if they have higher version that installed. 
Repoquery shows all installed and available packages
Size differs, because download size of package is not same that installed size.  Both sizes are named as Size.
Anyway we will open a discussion how it should work in future.

Comment 12 Jaroslav Mracek 2016-04-08 16:13:03 UTC
I made new PR (https://github.com/rpm-software-management/dnf-plugins-core/pull/155) that should change behavior of repoquery --info. We will see, if it will be accepted.

Comment 13 Stephen Wadeley 2016-06-07 05:45:38 UTC
commit 25fff2b32d4a011f03214326dc68eab853c2098a
Author: Stephen Wadeley <swadeley>
Date:   Tue Jun 7 07:39:04 2016 +0200

    dnf repoquery
    
    Bug 607270 - Repo Query


Note You need to log in before you can comment on or make changes to this bug.