Bug 1479330

Summary: DNF 2.0: bash-completion not working by default, until sqlite is installed
Product: [Fedora] Fedora Reporter: rockonthemoonfm
Component: dnfAssignee: Igor Gnatenko <ignatenko>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 26CC: decathorpe, dmach, jeremy9856, jmracek, kparal, mhatina, packaging-team-maint, pnemade, robin.a.meade, rockonthemoonfm, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-03 15:08:59 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 rockonthemoonfm 2017-08-08 11:28:31 UTC
even if /usr/share/bash-completion/completions/dnf is present, DNF version 2.0 lost auto-completion in my system - probably due to new version breakage?
It's a very useful feature when removing, but also installing packages!

Comment 1 Igor Gnatenko 2017-08-09 10:49:04 UTC
What means that it doesn't work?

Comment 2 jeremy9856 2017-09-09 17:23:28 UTC
Is it a duplicate bug 1490049 ?

Comment 3 jeremy9856 2017-09-10 08:12:31 UTC
So it seem that bug 1490049 is a duplicate. Here is what happened :

The completion doesn't work ootb for dnf on KDE spin (work ootb on official Fedora). I found that it can be because the file /etc/bash_completion.d/dnf-completion.bash is missing.

https://ask.fedoraproject.org/en/question/69318/dnf-bash-completion/?answer=69324#post-id-69324

Well after I added that file and rebooted dnf bash completion worked again !

I removed the file and rebooted waiting for a proper fix and dnf bash completion is still working !

The dnf-completion.bash is an old version of the file /usr/share/bash-completion/completions/dnf that is installed by dnf. 

Now if I remove this file (/usr/share/bash-completion/completions/dnf) the dnf bash completion doesn't work and if I put it back the dnf completion work again.

Don't know why it didn't work ootb and work now. Creating a /etc/bash_completion.d/dnf-completion.bash file that contain the same content as /usr/share/bash-completion/completions/dnf somewhat triggered the dnf completion.

Comment 4 jeremy9856 2017-09-10 14:13:23 UTC
I thought it was working ootb on official Fedora but no. That said after I finished to install and tweak it the dnf completion was working !

Comment 5 Fabio Valentini 2017-09-17 07:38:06 UTC
Installing the sqlite package fixed it for me. Why that package isn't part of a default install of f26 I don't know.

Comment 6 jeremy9856 2017-09-17 08:13:39 UTC
Well that worked, thanks ! What surprise me it's on a previous install of Fedora 26, installing sqlite didn't made bash completion work.

Comment 7 Parag Nemade 2017-09-17 13:04:59 UTC
I installed Fedora 27 on my laptop which was running find Fedora 26 along with bash completion. Since then bash completion has stopped working. I tried to find what else I have missing but could not find. I think I have all the needed files/packages and bash completion for commands like "dnf install TAB TAB" should work but it is not working.

So question is has something got broken recently? I have these packages
$ rpm -qa | grep dnf |sort
dnf-2.6.3-11.fc27.noarch
dnf-conf-2.6.3-11.fc27.noarch
dnf-plugins-core-2.1.3-2.fc27.noarch
dnf-yum-2.6.3-11.fc27.noarch
libdnf-0.9.3-7.fc27.x86_64
python2-dnf-2.6.3-11.fc27.noarch
python3-dnf-2.6.3-11.fc27.noarch
python3-dnf-plugins-core-2.1.3-2.fc27.noarch
libsolv-0.6.29-1.fc27.x86_64
libdnf-0.9.3-7.fc27.x86_64

Comment 8 Parag Nemade 2017-09-17 13:21:25 UTC
Looks like after installing sqlite package bash completion start to work.

Comment 9 Kamil Páral 2017-10-04 13:12:44 UTC
I can confirm this. dnf completion on package names (dnf install ht<TAB>) is not working, until "sqlite" package gets installed. Please fix.

Comment 10 Igor Gnatenko 2018-01-03 15:08:59 UTC

*** This bug has been marked as a duplicate of bug 1469667 ***

Comment 11 Jaroslav Mracek 2018-06-28 08:29:37 UTC
The issue is solved by dnf-3.0.1-1 that was released into rawhide.