Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature to search for packages #1877

Closed
FredChores opened this issue Jul 27, 2019 · 7 comments · Fixed by #4478 or #4490
Closed

Add feature to search for packages #1877

FredChores opened this issue Jul 27, 2019 · 7 comments · Fixed by #4478 or #4490
Assignees
Labels
good-first-issue good issue for someone new jira for syncing to jira kind/enhancement

Comments

@FredChores
Copy link

Host system details
any

Provide the output of rpm-ostree status.

State: idle
AutomaticUpdates: disabled
Deployments:
● ostree://fedora-iot:fedora/devel/aarch64/iot
                   Version: 30.20190710.3 (2019-07-10T18:26:19Z)
                    Commit: 4be9d4d49d76d77e8b40eb4d366cfcaffa0a5998eeef6d5c96a1e3aff9bf154f
              GPGSignature: Valid signature by C2A3FA9DC67F68B98BB543F47BB90722DBBDCF7C

  ostree://fedora-iot:fedora/devel/aarch64/iot
                   Version: 30.20190427.0 (2019-04-27T12:41:31Z)
                    Commit: 6165b819857a4439ae312892631b2c885a80312e986ce4a9c0973a84f49e0ff8
              GPGSignature: Valid signature by C2A3FA9DC67F68B98BB543F47BB90722DBBDCF7C

Expected vs actual behavior

# rpm-ostree search package
Usage:
  rpm-ostree [OPTION…] COMMAND

Builtin Commands:
  compose          Commands to compose a tree
  cleanup          Clear cached/pending data
  db               Commands to query the RPM database
  deploy           Deploy a specific commit
  rebase           Switch to a different tree
  rollback         Revert to the previously booted tree
  status           Get the version of the booted system
  upgrade          Perform a system upgrade
  reload           Reload configuration
  usroverlay       Apply a transient overlayfs to /usr
  cancel           Cancel an active transaction
  initramfs        Enable or disable local initramfs regeneration
  install          Overlay additional packages
  uninstall        Remove overlayed additional packages
  override         Manage base package overrides
  reset            Remove all mutations
  refresh-md       Generate rpm repo metadata
  kargs            Query or modify kernel arguments

Help Options:
  -h, --help       Show help options

Application Options:
  --version        Print version information and exit

error: Unknown command 'search'

Expected:

# rpm-ostree search package

Matching packages found:
1. package - a package of a program you may want to install
2. packaged - a daemon for something having to do with a package
3. ...

Select an above option or press 'q' to quit: 

Steps to reproduce it
Trying to find packages to install with rpm-ostree, trying to find documentation describing how to find packages to install with rpm-ostree, etc.

Would you like to work on the issue?
Since I have no idea how to accomplish basic tasks with this program despite reading the documents, I don't think that's possible.

@rfairley
Copy link
Contributor

I think the reason a search functionality isn't currently available with rpm-ostree is that in general, since rpm-ostree promotes an immutable host OS, you'd more often install additional packages inside a container running on your host using dnf. dnf could be used within the container, and you could search for packages there as you would in a traditional OS.

Installing new packages directly onto the host via package layering (i.e. rpm-ostree install <package>) comes in handy for situations where the base packages aren't enough, e.g. I have vagrant-libvirt layered on my Silverblue desktop so I can run libvirt VMs using Vagrant directly on the host. If you haven't seen, there are some docs for layering packages in IoT [1].

I agree though - a search feature in rpm-ostree would be useful, as an enhancement when looking for packages to layer. Just wanted to point out rpm-ostree may not necessarily have the same UX features as dnf, as it's not meant to be a replacement (related for Silverblue: [2]). Though, the functionality overlaps here.

[1] https://docs.fedoraproject.org/en-US/iot/add-layered/
[2] https://discussion.fedoraproject.org/t/framing-rpm-ostree-in-silverblue/1732/2

@rfairley rfairley changed the title Can't search for packages Add feature to search for packages Jul 29, 2019
@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Sep 24, 2021

http://github.com/coreos/rpm-ostree/issues/1877#issuecomment-516060581.

Currently, for Rawhide of Fedora Silverblue, Firefox and GNOME Connections are installed as RPM packages, although they are both operational perfectly as Flatpak packages. Therefore, I may want to ascertain what the name of the package of GNOME Connections is so that I shall be able to uninstall it. Currently, this is difficult, because ascertainment of the name of any package shall require usage of toolbox, the internet, and/or the package-manager of another operating-system that has been installed as one virtual machine.

Consequently, for me, the ability to search for packages shall assist the usage of one truly immutable base operating-system, because I shall be able to install more packages as flatpak software if I am able to ascertain what to remove from it.

Also, for Kinoite, many important RPM packages have not been installed (all of the modules that are for systemsettings5) so this is important for addition of basic functionality.

@thorhop
Copy link

thorhop commented Nov 4, 2021

rpm-ostree is technically the system package manager and should have features for discoverability. For me this means that rpm-ostree should not only be able to search for packages with the currently running base in mind, but also search for packages that relate to other ostree refs and bases. Right now I have to go into toolbox and search. If I want to do a comparison between system versions I have to create another toolbox, install even more cruft on my system and generally have to jump through hoops to get anywhere.

I think that a search function in rpm-ostree should be a no-brainer, since you'd not only be using rpm-ostree to install an image, but also to build one using compose. Therefore the functionality of searching repos for various packages and such a fundamental feature for system administration, as well as image creation.

Starting from scratch wouldn't be advisable, but rpm-ostree should provide search functions specific to ostree systems that are aware or can be aware of other ostree based systems. For instance:

rpm-ostree search -r fedora:fedora/34/x86_64/silverblue dracut would search for the version of dracut in the f34 repo, despite the fact that I am currently running silverblue 35. This allows me to do research on the system regarding availability of the packages for that specific ref. If someone makes deb-ostree at some point it would also be cool to then do rpm-ostree search -r ubuntu:ubuntu/21.08/x86_64/kubuntu dracut to see what version of packages is inside that repo. In fact, that would be kind of awesome.

Again, the argument would probably be "just make an alias to dnf inside a toolbox", but if rpm-ostree is also meant to be a tool to compose ostree images using RPMs and dnf/yum repos it should definitely also have a search function. For me it is definetely necessary for me as a system administrator, as I layer packages like a madman. So search functionality is a must.

@travier travier added the good-first-issue good issue for someone new label Mar 15, 2022
@cgwalters
Copy link
Member

This heavily relates to/intersects with #2883

@rugk
Copy link

rugk commented Oct 15, 2022

This issue has been linked and is apparently needed for good gnome software support of Silverblue-like package layering.

See https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1793

@lukewarmtemp lukewarmtemp self-assigned this Jun 7, 2023
@lukewarmtemp lukewarmtemp added the jira for syncing to jira label Jun 7, 2023
@jmarrero
Copy link
Member

@cgwalters
We are looking at #4099 as a template to implement this.
As a first pass concentrating on the daemon side, maybe a second PR is dealing with the container path. If understand correctly we would want to make the changes in: rpmostreed-os similar to os_handle_what_provides.

One question here is your comment on https://gitlab.gnome.org/GNOME/gnome-software/-/issues/1793: It came to light that gnome-software is using libdnf directly and trying to access rpm-ostree's caches

By using the os_create_dnf_context_simple to get the dnfctx we are not re-creating the problem on rpm-ostree side right? We do want to use libdnf thru this path using the context and then calling search thru the hawkey api like hy_query_filter

@cgwalters
Copy link
Member

Yes, we'd need a DBus API and then a path which bypassed that for the container flow.

For the underlying code, it may be worth at least referencing https://github.com/rpm-software-management/dnf5/blob/main/dnf5/commands/search/search_processor.cpp (dnf5 is now in c++ which we could use directly). Maybe even copy/paste some code for now. (Of course ideally new code is in Rust too...)

lukewarmtemp added a commit to lukewarmtemp/rpm-ostree that referenced this issue Jun 21, 2023
This closes a longstanding feature request and improves compatibility
with the `dnf`/`yum` CLI.

The feature set and output text intentionally matches that tool, e.g.
globs like `rpm-ostree search kernel*` and multi term searches like
`rpm-ostree search kernel python` are supported.

Search results per section are limited to 50 due to DBus message size
limits.

Closes: coreos#1877
lukewarmtemp added a commit to lukewarmtemp/rpm-ostree that referenced this issue Jun 22, 2023
This closes a longstanding feature request and improves compatibility
with the `dnf`/`yum` CLI.

The feature set and output text intentionally matches that tool, e.g.
globs like `rpm-ostree search kernel*` and multi term searches like
`rpm-ostree search kernel python` are supported.

Search results per section are limited to 50 due to DBus message size
limits.

Closes: coreos#1877
lukewarmtemp added a commit to lukewarmtemp/rpm-ostree that referenced this issue Jun 22, 2023
This closes a longstanding feature request and improves compatibility
with the `dnf`/`yum` CLI.

The feature set and output text intentionally matches that tool, e.g.
globs like `rpm-ostree search kernel*` or multi term searches like
`rpm-ostree search kernel python` are supported.

Search results per section are limited to 50 due to DBus message size
limits.

Closes: coreos#1877
lukewarmtemp added a commit to lukewarmtemp/rpm-ostree that referenced this issue Aug 8, 2023
This closes a longstanding feature request and improves compatibility
with the `dnf`/`yum` CLI.

The feature set and output text intentionally matches that tool, e.g.
globs like `rpm-ostree search kernel*` or multi term searches like
`rpm-ostree search kernel python` are supported.

Search results per section are limited to 50 due to DBus message size
limits.

Closes: coreos#1877
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue good issue for someone new jira for syncing to jira kind/enhancement
Projects
None yet
9 participants