RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2128210 - dnf autocomplete too slow
Summary: dnf autocomplete too slow
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: dnf
Version: 9.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: Tomáš Bajer
URL:
Whiteboard:
Depends On: 1815895
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-09-20 08:35 UTC by Robin Jarry
Modified: 2023-05-09 10:24 UTC (History)
27 users (show)

Fixed In Version: dnf-4.14.0-1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of: 1815895
Environment:
Last Closed: 2023-05-09 08:18:23 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management dnf pull 1817 0 None Merged bash-completion: use sqlite cache when available (BZ: 1815895) 2022-09-20 08:35:00 UTC
Red Hat Issue Tracker RHELPLAN-134399 0 None None None 2022-09-20 09:17:58 UTC
Red Hat Product Errata RHBA-2023:2490 0 None None None 2023-05-09 08:18:28 UTC

Description Robin Jarry 2022-09-20 08:35:01 UTC
Could we get this fix backported into RHEL 8.4?

+++ This bug was initially created as a clone of Bug #1815895 +++

Description of problem:

dnf is taking too much time (many seconds) to autocomplete packages names with <tab>.


Version: 4.2.19


Steps to Reproduce:

Type: sudo dnf install <any letter> them <tab> or <tab><tab>

Actual results:

Taking many seconds to show completion options.

Expected results:

Display options almost instantly.

Additional info:

none

--- Additional comment from Ben Cotton on 2020-11-03 17:08:55 UTC ---

This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

--- Additional comment from Kwan Lowe on 2021-01-20 04:08:12 UTC ---

Just wanted to add that this still exists in Fedora 33. The autocomplete from the command line still takes a long time (10s or more) if any package lists are required (install, localinstall, remove, grouplist, etc.).   Even localinstall which should just check the local path seems to try to parse the 80K packages available in my default set of repos.

Currently I'm just moving/deleting /usr/share/bash-completions/completions/dnf to disable the autocomplete entirely, but would be a useful feature if it weren't for the annoying pause. This disablement lasts until the next time dnf is updated.

From what I can see, the _dnf_show_packages func is called for install, localinstall, remove, reinstall, etc.. At the least, the localinstall should just check the current directory or whatever path is already prepended. I.e., separate the localinstall completion to use something like:
  complete -f -o plusdirs -X '!*.@(rpm)' dnf

--- Additional comment from Ben Cotton on 2021-02-09 16:15:54 UTC ---

This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

--- Additional comment from christianbueno on 2021-05-12 02:01:21 UTC ---

Here an example trying to install pipewire.
DNF take long time to autocomplete, as a user of fedora it is not a new thing about DNF.
I like DNF and how the information is structured and the order as is presented the result.

--- Additional comment from christianbueno on 2021-05-12 02:12:04 UTC ---



--- Additional comment from Jiří Vyskočil on 2021-07-23 10:47:53 UTC ---

Autocompletion for dnf is still slow in bash, as mentioned in the previous (now automatically closed) bug 1227979. It's a bash-specific problem, i.e. in zsh, tab completion for dnf is almost instant.

--- Additional comment from  on 2021-12-23 10:14:15 UTC ---

Just adding that I noticed this this on Fedora 35.

--- Additional comment from Kwan Lowe on 2022-03-03 13:35:02 UTC ---



--- Additional comment from Kwan Lowe on 2022-03-03 13:39:12 UTC ---

I put in a hack to skip the full package list check when doing "localinstall" which is where most of the frustration lies for me. I don't know if much can be done about packages that need to pull form external repos. This was mainly tested on RHEL8 but seems to work on Fedora.

--- Additional comment from Robin Jarry on 2022-03-08 21:08:32 UTC ---

I have submitted a fix https://github.com/rpm-software-management/dnf/pull/1817 which is waiting for review.

--- Additional comment from Robin Jarry on 2022-04-27 14:04:48 UTC ---

The fix was applied upstream. It should be available in the next release of dnf.

--- Additional comment from Jiří Vyskočil on 2022-04-28 05:58:13 UTC ---

Thank you, Robin! This has been bugging me for such a long time (it's been there for years - mentioned in various other bug reports). It's absolutely awesome to hear that it's been finally fixed. Can't wait until the next dnf release gets on my machine :-)

Comment 1 Nicola Sella 2022-09-27 11:37:09 UTC
Hello, this bug is not a good candidate for z-stream since the impact is not big, and it doesn't have any customer ticket. Furthermore, we would like to see it landing in Fedora first.

Comment 2 Robin Jarry 2022-09-27 11:43:58 UTC
Hi Nicola,

This has been included in dnf 4.14.0: https://github.com/rpm-software-management/dnf/commit/c1a407eba3236ec42b916dd307c56ba9689fc026

As far as I can see, it is available in Fedora updates for both f35 and f36:

https://bodhi.fedoraproject.org/updates/FEDORA-2022-8628e5ac7f
https://bodhi.fedoraproject.org/updates/FEDORA-2022-ec6bbd5493

Comment 3 Nicola Sella 2022-09-27 11:55:15 UTC
> This has been included in dnf 4.14.0: https://github.com/rpm-software-management/dnf/commit/c1a407eba3236ec42b916dd307c56ba9689fc026

Whops, I have missed that. Thank you for pointing it out.

> Hello, this bug is not a good candidate for z-stream since the impact is not big, and it doesn't have any customer ticket

As mentioned before, it will most likely not be included in z-stream. It will land in 9.3 most likely.

Comment 4 Robin Jarry 2022-09-27 11:56:48 UTC
Ok, that's too bad :) Should I close this?

Comment 5 Nicola Sella 2022-09-27 12:13:36 UTC
> Ok, that's too bad :) Should I close this?

No need, I would keep it open and change the product to RHEL9. Thanks for the report, anyway.

Comment 14 errata-xmlrpc 2023-05-09 08:18:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (dnf bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2490


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