Bug 1234491

Summary: [UX] dnf list installed: show repo id the package was installed from
Product: [Fedora] Fedora Reporter: Alan Stern <stern>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 22CC: jsilhan, mluscon, packaging-team-maint, pnemade, rholy, tim.lauridsen, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: dnf-1.1.2-4.fc23 dnf-1.1.2-4.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-04 19:13:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alan Stern 2015-06-22 16:07:57 UTC
Description of problem:  The "dnf list available" command doesn't list packages that are currently installed.  According to the man page for dnf, a package is supposed to be "available" if it is present in a repository that dnf knows about -- whether or not it is installed should be irrelevant.


Version-Release number of selected component (if applicable):
dnf-1.0.0-1.fc22.noarch


How reproducible:  100%


Steps to Reproduce:  Here's an example.  On my system, bash was installed (by fedup, upgrading from Fedora 20) from the "fedora" repository:

# dnf list installed bash
Last metadata expiration check performed 0:26:56 ago on Mon Jun 22 11:02:39 2015.
Installed Packages
bash.i686                         4.3.39-1.fc22                          @System

The output says "@System" rather than "fedora"; it does this for all installed packages no matter where they came from.  Why?

# dnf list available bash
Last metadata expiration check performed 0:35:45 ago on Mon Jun 22 11:02:39 2015.
Error: No matching Packages to list

This is wrong -- obviously the bash package is available in the fedora repo.

The "dnf repository-packages <repoid> list available" command has the same bug.  Even worse, "dnf repository-packages <repoid> list installed" lists only a few of the packages that should be there.  Example:

# dnf repository-packages fedora list installed | more
Last metadata expiration check performed 1:00:37 ago on Mon Jun 22 11:02:39 2015.
Installed Packages
gnupg.i686                              1.4.19-1.fc22                    @System
ipsec-tools.i686                        0.8.1-6.fc22                     @System
python3-rpmconf.noarch                  1.0.7-1.fc22                     @System
rpm-python3.i686                        4.12.0.1-9.fc22                  @System
rpmconf.noarch                          1.0.7-1.fc22                     @System
rpmconf-base.noarch                     1.0.7-1.fc22                     @System

That's all!  Even though there are over 2600 packages installed on this machine, most of which come from the fedora repository (I assume -- there doesn't seem to be any way to tell for certain.)

Comment 1 Honza Silhan 2015-07-01 09:43:20 UTC
It seems like also in the yum in, the list command the term "available" means "available in repositories while not being installed". List is just brief overview of packages thats why there are not duplicated from installed category. For listing all packages in repos regardless whether thy are installed or not one should use "dnf repoquery" (from dnf-plugins-core package that should be installed by default). With respect, I am changing this bug report to "show repo the package was installed from" as your second use case could be solved by "dnf repoquery".

Comment 2 Alan Stern 2015-07-01 14:46:02 UTC
Okay, I tried "dnf repoquery" and it worked.  Thanks.

Still, I think the man pages need to be fixed.  They should explain the correct meaning of "available"; as it stands the explanation is wrong.

For example, in the "List Command" subsection of the man page for "dnf", it says:

       Generally packages are available (it is present in a repository we
       know  about)  or installed (present in the RPMDB).

It should say something like this:

       A package is installed if it is present in the RPMDB, and it is available
       if it is not installed but it is present in a repository that dnf knows
       about.

The explanations for the "dnf  [options]  repository-packages  <repoid>  info  available" and "dnf  [options]  repository-packages  <repoid>  list  available" commands should say that they

       List packages available in the repository but not currently installed
       on the system.

Comment 3 Honza Silhan 2015-07-03 18:07:45 UTC
Thanks for exact sentences -> fixed in the upstream.

Comment 4 Honza Silhan 2015-07-07 09:19:48 UTC
* only the doc part was fixed in https://github.com/rpm-software-management/dnf/commit/8876b30dc10cca975a83414acd30c40f85c11ae6

The output of installed repo names is not yet implemented.

Comment 5 Fedora Update System 2015-09-22 15:00:48 UTC
hawkey-0.6.1-1.fc23 dnf-plugins-core-0.1.12-2.fc23 dnf-1.1.2-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16428

Comment 6 Fedora Update System 2015-09-22 15:02:56 UTC
dnf-plugins-core-0.1.12-2.fc22 hawkey-0.6.1-1.fc22 dnf-1.1.2-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16429

Comment 7 Fedora Update System 2015-09-23 03:54:33 UTC
dnf-1.1.2-2.fc23, dnf-plugins-core-0.1.12-2.fc23, hawkey-0.6.1-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update dnf-plugins-core dnf hawkey'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16428

Comment 8 Fedora Update System 2015-09-23 21:22:25 UTC
dnf-1.1.2-2.fc22, dnf-plugins-core-0.1.12-2.fc22, hawkey-0.6.1-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update dnf-plugins-core dnf hawkey'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16429

Comment 9 Fedora Update System 2015-10-02 15:20:33 UTC
dnf-plugins-core-0.1.12-3.fc23 hawkey-0.6.1-2.fc23 dnf-1.1.2-4.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-38e69423f3

Comment 10 Fedora Update System 2015-10-02 15:24:35 UTC
dnf-plugins-core-0.1.12-3.fc22 hawkey-0.6.1-2.fc22 dnf-1.1.2-4.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-3528c659e4

Comment 11 Fedora Update System 2015-10-04 01:36:09 UTC
dnf-1.1.2-4.fc22, dnf-plugins-core-0.1.12-3.fc22, hawkey-0.6.1-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hawkey dnf-plugins-core dnf'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-3528c659e4

Comment 12 Fedora Update System 2015-10-04 01:52:03 UTC
dnf-1.1.2-4.fc23, dnf-plugins-core-0.1.12-3.fc23, hawkey-0.6.1-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hawkey dnf-plugins-core dnf'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-38e69423f3

Comment 13 Fedora Update System 2015-10-04 19:12:54 UTC
dnf-1.1.2-4.fc23, dnf-plugins-core-0.1.12-3.fc23, hawkey-0.6.1-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2015-10-05 21:52:23 UTC
dnf-1.1.2-4.fc22, dnf-plugins-core-0.1.12-3.fc22, hawkey-0.6.1-2.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.