Why bash auto-completion is so slow with DNF?

Why bash (press tab twice) auto-completion is so slow with DNF? It’s really slow and sometimes completely freezes (if you press tab too many times). I love DNF, but this is so annoying. Auto-completion works with APT fine every time, why it doesnt with DNF?

It is difficult to answer this question. Please give a bit more Information on which Desktop environment you are and on which Fedora Version.

Just a note beside, in F39 dnf will be substituted with dnf5. If you want to thest it on F38 you can install it with the package dnf5 to see if you get the same performance.


cat /etc/os-release
AME="Fedora Linux"
VERSION="38 (Workstation Edition)"
dnf --version

With dnf5 tab doesnt work at all :(, what do I need to do ?

I think I saw a notification that dnf5 is no longer scheduled for F39. It apparently was not ready at the time F39 was branched.

1 Like

And auto-completion is has been slow with dnf for years, whatever version, installation or device was. Doesn’t anyone else noticed this difference to apt?

Thanks for that info. I not saw that yet … but in the Release Notes id disappeared already.

I just did a clean install of the F39 (branched) iso and dnf5 is not installed. Dnf version 4.16.2 is installed there.

do you have sqlite installed?
sudo dnf list installed sqlite



dnf list --installed sqlite
Error: No matching Packages to list

please install it and see if it improves the situation.
sudo dnf install sqlite

1 Like

One would need to be actively comparing both apt and dnf to see the differences.

Just note:
For dnf to do an auto-complete it must connect to the repos and query the partial package name entered. With a main fedora repo that easily contains over 5000 discrete packages that connection and search will of necessity take some time. Adding in several other repos as well simply extends the time required.

How that might compare to using apt on mint, ubuntu, debian, etc. is something I have never wished to explore. Different tools and repos function differently.

If you are unhappy with the way it is then please let the developers hear your complaint by filing a bug. Many of us have been using fedora as-is for many years and I have never seen the tab completion for dnf as an issue in this forum.

I am wondering why I see several nit-picking type posts from you in the last 2 days. Most users work with a distro for some time before they start digging as you have done.

Btw since when dnf list --installed can be typed dnf list installed?

Why I need sqlite for this? :sweat_smile:


since forever. That is 2 different ways to do the same thing.

Think of it as an alias such as dnf update is an alias for dnf upgrade (as is dnf up).
And yum is an alias for dnf and for dnf4 (all of which are aliases for `dnf-3).

No, auto-complete do query to local db. It doesn’t need network connection. That’s why it’s strange that dnf is so slow with this job.

Of course, but difference is literally big. Apt is instant but dnf takes several seconds.

Amazing!!! It works and the difference is huge! Why Fedora doesn’t ship this by default? Why this isn’t depency of dnf?’

Difference is from 3:48s to less than 0:75. Now auto-completion is instant!

/usr/bin/yum and /usr/bin/dnf are symlinks to /usr/bin/dnf-3, that’s it. Do you have /usr/bin/dnf-4? My Fedora Linux 38 doesn’t seem contain it. And I know that many programs have alias for same task, like update is alias for upgrade (yes, nowdays upgrade is dnf’s default and update is deprecated alias), but think is I didn’t know dnf allows type installed without double dashs. Also, I don’t find that on the docs. Where is this documented?

Completion logic is implemented as a bash function.
You can look at that function to see how it works and then time the key command used to query the data needed for completion.

1 Like