Bug 1979048 - search for a not-installed program should offer a package that provides the program if available
Summary: search for a not-installed program should offer a package that provides the p...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: libdnf
Version: 34
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-04 14:14 UTC by George N. White III
Modified: 2022-05-16 05:24 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2022-05-16 05:24:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description George N. White III 2021-07-04 14:14:41 UTC
Description of problem:

On Fedora 34, updated using dnf.  Entering a command that is not installed at the zsh or bash prompt should offer to install the package that provides the command, but is giving:
 
"repo_add_solv() has failed."


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

    Installed Packages
    Name         : libdnf  
    Version      : 0.63.1
    Release      : 1.fc34
    Architecture : x86_64
    Source       : libdnf-0.63.1-1.fc34.src.rpm
    Repository   : @System
    From repo    : updates


How reproducible:

reliably

Steps to Reproduce:
1. attempt to run "xindy in a terminal with zsh:

Actual results:

     % xindy
     zsh: xindy: command not found...
     Failed to search for file: repo_add_solv() has failed.

     $ xindy
    bash: xindy: command not found...
    Failed to search for file: repo_add_solv() has failed.


Expected results:

Offer to install the texlive-xindy package.

Additional info:

Checking journalctl -b show entries for "repo_add_solv() has failed":

Jul 04 09:43:47 X gnome-software[2104]: not handling error failed for action get-updates-historical: repo_add_solv() has failed.
Jul 04 09:44:21 X gnome-software[2104]: not handling error failed for action refine: failed to resolve package_ids: repo_add_solv() has failed.

Comment 1 amatej 2021-07-12 13:40:50 UTC
I have tried this on a fresh Fedora 34 install and it worked fine both in bash and zsh.
Something is likely wrong with your system but its hard to tell at this point.

It seems you are still able to use dnf but can you use gnome-software? Also can you try installing package through pkcon and microdnf?
$ pkcon install htop
$ microdnf install htop 
(microdnf might not be installed on your system)

Comment 2 George N. White III 2021-07-14 15:13:59 UTC
Sorry for the delay in responding -- my network switch died (on Day 1 of the Tour de France!), and has now been replaced.

I agree with the observation that "Something is likely wrong with your system".  I probably would not have filed a bugzilla
report, but someone on a forum suggested removing packagekit if you don't use Gnome Software, so this bug reveals a dependence
on packagekit.  Many of my colleagues are new to linux and attempting to do batch processing using shell scripts provided by
"subject matter experts".  Having the shell point to the missing package has been helpful in reducing "the script doesn't work"
threads in subject matter forums.

Gnome Software is also giving "repo_add_solv() has failed"

    % sudo pkcon install htop
    [sudo] password for gwhite: 
    Resolving                     [===                      ] (13%)  Command failed: This tool could not find any available package: repo_add_solv() has failed.

    [gwhite@dormarth]~% sudo microdnf install htop
    Downloading metadata...
    [...]
    Downloading metadata...
    Package                                                                                                Repository                              Size
    Installing:                                                                                                                                        
     htop-3.0.5-4.fc34.x86_64                                                                              fedora                              157.6 kB
    Transaction Summary:
     Installing:        1 packages
     Reinstalling:      0 packages
     Upgrading:         0 packages
     Obsoleting:        0 packages
     Removing:          0 packages
     Downgrading:       0 packages
    Is this ok [y/N]: y
    Downloading packages...
    Running transaction test...
    Installing: htop;3.0.5-4.fc34;x86_64;fedora
    Complete.

Comment 3 amatej 2021-07-15 05:01:04 UTC
I see, well yes this functionality of: "entering a command that is not installed at the shell leads to offering to install the package" is provided by PackageKit-command-not-found package which depends on PackageKit.
Given that microdnf works while pkcon and gnome-software don't (both use PackageKit) it seems to problem is not in libdnf but indeed in PackageKit.

I am a bit confused if you had removed PackageKit it should have uninstalled also PackageKit-command-not-found and there should be no pkcon command available, unless you didn't use dnf to remove it?

You could try:
$ dnf install PackageKit
or if its installed but somehow broken:
$ dnf reinstall PackageKit
to fix your problems.

Comment 4 Ben Cotton 2022-05-12 16:30:41 UTC
This message is a reminder that Fedora Linux 34 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 34 on 2022-06-07.
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
'version' of '34'.

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

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 34 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 Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.


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