Bug 1301322 - [RFE] dnf search does not show if package is installed
Summary: [RFE] dnf search does not show if package is installed
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-24 06:00 UTC by Niels Kobschätzki
Modified: 2024-02-20 11:56 UTC (History)
21 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-25 13:28:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Niels Kobschätzki 2016-01-24 06:00:07 UTC
Description of problem:
FutureFeature
"dnf search" shows a list of packages as a result of the search. The list doesn't show which of the packages in the results are already installed.

Version-Release number of selected component (if applicable):
1.1.5

How reproducible:
Install a package with dnf and search for it

Steps to Reproduce:
1.dnf install "some package"
2.dnf search "some package"


Actual results:
A list of search results which includes the installed package without further information if it is installed

Expected results:
The package should have something like [installed] after its name or description

Additional info:

Comment 1 Michal Domonkos 2016-01-25 13:28:27 UTC
By design, showing this kind of status is not in the scope of the search command.  To list the installed packages, please use the "dnf list installed" command instead.

Comment 2 Tobias Frei 2020-08-17 18:04:06 UTC
(In reply to Michal Domonkos from comment #1)
> By design, showing this kind of status is not in the scope of the search
> command.  To list the installed packages, please use the "dnf list
> installed" command instead.

Please reconsider this design and reopen the bug as a low-priority feature request.

A full list of installed packages is not a useful substitute for the suggested "installed" indicator in a list of package search results, such as conveniently, fortunately shown by package managers like apt.

Comment 3 Michal Domonkos 2020-08-18 06:22:00 UTC
Tobias, that makes sense.  I'm reopening this for the DNF folks to revisit.

Comment 4 Jaroslav Rohel 2020-08-24 10:38:58 UTC
Try to use "repoquery" command. It is not as "apt search", but it can help.
"repoquery" allows to define format of output (--qf 'format string') and to add reason of instalation to the output.

Examples:
search keys only in installed packages: "dnf repoquery --installed key1 key2 ..."

search keys only in installed packages and print info about reason of  installation - user, dependency, ... : "dnf repoquery --installed --qf '%{reason} %{name}-%{evr}.%{arch}' key1 key2 ..."

search keys in all packages and print info about reason of installation - user, dependency, ..., (none) - if package is not installed: "dnf repoquery  --installed --available --qf '%{reason} %{name}-%{evr}.%{arch}' key1 key2 ..." (If a package is available in a repository and is installed too, it is printed two times - as installed, and as (none) for repository).

Comment 5 Raúl 2020-10-07 07:22:36 UTC
I think that is an important missing feature.

Comment 6 Giovanni Pelosi 2021-01-20 22:43:48 UTC
The point is to look for "uninstalled" things to install.

The equivalent apt is:

apt search xfce | grep -v installed

Comment 7 chenhaixing 2022-06-20 03:41:30 UTC
Hi,I've read your question.
I think the purpose of "dnf search" is to search for keywords.
Command:
dnf list --installed
dnf list --installed | grep keywords
It displays the installed packages.


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