Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

YUM error shows on output #143

Open
Juan-de-Costa-Rica opened this issue May 2, 2024 · 16 comments
Open

YUM error shows on output #143

Juan-de-Costa-Rica opened this issue May 2, 2024 · 16 comments

Comments

@Juan-de-Costa-Rica
Copy link

Running on fresh Fedora atomic I get this error showing up after GPU and before Packages:

error: unrecognized subcommand 'list'

  tip: a similar subcommand exists: 'install'

Usage: yum [OPTIONS] <COMMAND>

For more information, try '--help'.

Screenshot from 2024-05-01 21-41-33

@TanmayPatil105
Copy link
Owner

That's interesting!!
Can you put the output of dnf list installed here?

@TanmayPatil105
Copy link
Owner

In our code, we're executing dnf list installed https://github.com/TanmayPatil105/procfetch/blob/main/src/fetch.cpp#L422.
AFAIK in the latest Fedora versions, yum is symlinked to dnf. I'm not sure how yum is getting invoked here.

@Juan-de-Costa-Rica
Copy link
Author

That's interesting!! Can you put the output of dnf list installed here?

Same error:

❯ dnf list installed
error: unrecognized subcommand 'list'

  tip: a similar subcommand exists: 'install'

Usage: yum [OPTIONS] <COMMAND>

For more information, try '--help'.

Screenshot from 2024-05-02 00-14-54

@TanmayPatil105
Copy link
Owner

I'm setting up Fedora 39 on my VM.
Meanwhile, What does man dnf say about listing all installed packages?

@Juan-de-Costa-Rica
Copy link
Author

I'm setting up Fedora 39 on my VM. Meanwhile, What does man dnf say about listing all installed packages?

Mind you I'm running Bluefin which is a version of Fedora Silverblue, the immutable version of Fedora. It doesn't ship with dnf.

https://blog.christophersmart.com/2020/04/18/making-dnf-on-fedora-silverblue-a-little-easier-with-bash-aliases/

@TanmayPatil105
Copy link
Owner

So, does yum list installed work?

@TanmayPatil105
Copy link
Owner

Well, dnf and yum are high-level package management tools which perform package management tasks on top of rpm.
And yes, we are displaying rpm packages!

@TanmayPatil105
Copy link
Owner

Also, I can see in your output hostname isn't getting displayed.
2422674 should fix it

@Juan-de-Costa-Rica
Copy link
Author

So, does yum list installed work?

Gives the same error.

@Juan-de-Costa-Rica
Copy link
Author

I think for immutable/atomic Fedora systems it would be nice to show how many packages are installed or 'layered' via rpm-ostree.

@TanmayPatil105
Copy link
Owner

Yupp!
I was thinking of something like:

  if (Path::of("/var/lib/rpm"s).isExecutable())
    {
        Command::exec_async("rpm -qa"s, [&](auto c) {
        std::lock_guard<std::mutex> lock(mtx);
       
        if (Path::of("/bin/dnf"s).isExecutable())
          pkgs.push_back(rec{"dnf"s, c->getOutputLines()});
        else if (Path::of("/bin/yum"s).isExecutable())
          pkgs.push_back(rec{"yum"s, c->getOutputLines()});
        else
          pkgs.push_back(rec{"rpm"s, c->getOutputLines()});
        });
    }

@TanmayPatil105
Copy link
Owner

I'm curious, what does neofetch display in the packages?

@Juan-de-Costa-Rica
Copy link
Author

I'm curious, what does neofetch display in the packages?

1982 (rpm), 69 (flatpak), 28 (brew)

Screenshot from 2024-05-02 10-19-57

@Juan-de-Costa-Rica
Copy link
Author

Yupp! I was thinking of something like:

For immutable/atomic Fedora you us rpm -qa to list your system packages and rpm status -v to list layered packages.

Output of rpm status -v looks like:

● fedora:fedora/35/x86_64/kinoite
                   Version: 35.20210924.n.0 (2021-09-24T08:10:09Z)
                BaseCommit: 8ca0e98140307a1124c34b3f73001b1cdd29178115c4e5b1e6436e36b0e0f613
              GPGSignature: Valid signature by 787EA6AE1147EEE56C40B30CDB4639719867C58F
       RemovedBasePackages: firefox 91.0.1-2.fc35
           LayeredPackages: zsh virt-manager vim doas fedora-workstation-repositories gstreamer1-plugin-openh264

  fedora:fedora/35/x86_64/kinoite
                   Version: 35.20210923.n.0 (2021-09-23T08:13:58Z)
                BaseCommit: 684ee39f6abc9a0b5bda5686a7eac92d02215ca42008a0bce38302bc1c280fef
              GPGSignature: Valid signature by 787EA6AE1147EEE56C40B30CDB4639719867C58F
       RemovedBasePackages: firefox 91.0.1-2.fc35
           LayeredPackages: zsh virt-manager vim doas fedora-workstation-repositories gstreamer1-plugin-openh264

@TanmayPatil105
Copy link
Owner

I think that would add more complexity.
Re-thinking: we should only display the output of rpm -qa. Showing package managers front-ends as package managers makes less sense.
We maintain the same approach in Debian-based distributions (dpkg and apt). and I think we should maintain that consistency throughout.

TanmayPatil105 added a commit that referenced this issue May 2, 2024
@TanmayPatil105
Copy link
Owner

153d2e0
I won't call it a "fix" but now it should work fine!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants