Why sqlite is not depency of dnf?

Auto-completion of bash for dnf is now too slow, because /usr/share/bash-completion/completions/dnf script needs sqlite to use /var/cache/dnf/packages.db for quick auto-completions. Without sqlite the script must parse repodata files.
For more info, see: https://github.com/rpm-software-management/dnf/pull/1817

dnf package contains /usr/share/bash-completion/completions/dnf script, so why sqlite is not depency of dnf?

There are many user reports of this problem:

Fedora Linux must ship quick auto-completion for dnf by default!

Check previous discussion about this: Why bash auto-completion is so slow with DNF? - #18 by karpe

The weak depends were removed because of this bug,

I’d suggest filing a new bug.

1 Like

Sigh, I wonder if RHEL can get that policy updated. This seems exactly what weak dependency is for, though it would help if there is a comment describing its necessity.

1 Like

Worst case we can maybe have it back In Fedora Linux and macro’d out for RHEL?

1 Like

Indeed, in fact I am thinking of putting up a PR for that tomorrow. Labor Day and all :⁠-⁠)

I think you want to make the PR against this instead


Why %elif 0%{?fedora} Recommends: (%{_bindir}/sqlite3 if bash-completion)? This isn’t Fedora spesific.

After re-reading the bug and the Fedora policy I felt like it stood a better chance of making it into Fedora

Can you explain, what is the problem? I can’t see that bug… Is the reason just something strange policy of RHEL? And if so, why Fedora Linux needs care about it? We are not RHEL.

What is macro’d?

From the bug:

RHEL 9 Content Structure and Guidelines state that weak dependencies in BaseOS are allowed, but discouraged.

By using the Recommends weak dependencies especially for packages in @core group (Minimal host installation) or their direct dependencies, the recommended package gets pulled into the installed package set depending on the current configuration of the dnf transaction.

The dnf package Recommends /usr/bin/sqlite3 if bash-completion and python3-dbus if NetworkManager.

If those packages are needed by dnf for correct operation when bash-completion and/or NetworkManager are also installed, Requires should be used.

If /usr/bin/sqlite3 and python3-dbus are essential in minimal host installations, they should be listed in the @core group in the comps file, not pulled in as a weak side-effect of having dnf in @core.

If they are listed primarily for convenience, Suggests might be better option. Or just drop the weak dependency completely.

%elif 0%{?fedora}

The pull request for this was merged yesterday.

Fedora Docs RPM Macros