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

Permit stacking multiple --offline commands for a single reboot. #2120

Open
RokeJulianLockhart opened this issue Mar 10, 2025 · 3 comments
Open

Comments

@RokeJulianLockhart
Copy link

RokeJulianLockhart commented Mar 10, 2025

Currently, multiple transactions with --offline cannot be performed sequentially on the next reboot, even though some commands must be separated into separate invocations in order to execute.

discussion.fedoraproject.org/t/146811 provides an example of when this is necessary and elaborates on how this appears to a user:

Example

Say that I want to invoke the undermentioned with upgrade's offline flag appended: 1

  1. sudo dnf update @multimedia --setopt="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin

  2. #!/usr/bin/env sh
    sudo dnf swap mesa-va-drivers mesa-va-drivers-freeworld && \
    sudo dnf swap mesa-vdpau-drivers mesa-vdpau-drivers-freeworld

Desire

However, I want to invoke them in the same sudo dnf5 offline reboot transaction.

Rationale

  1. I don't wish to reboot for each command.
  2. Attempting to stack them sequentially like one would a series of pre-authenticated -ys invokes offline clean for each subsequent invocation.

discussion.fedoraproject.org/t/146811/2 responds, confirming that this doesn't actually appear to be possible with DNF5:

Running multiple dnf {install/upgrade/swap/etc} commands with the --offline option is not a solution, as you might have already experienced, since upon running the second command (without rebooting), the first one will be cancelled:

There is already an offline transaction queued, initiated by the following command:
	dnf swap mesa-va-drivers mesa-va-drivers-freeworld --offline
Continuing will cancel the old offline transaction and replace it with this one.

It seems that dnf only accepts one offline transaction at a time. Stacking offline transactions would make sense, though.

Consequently, I suggest that this functionality be implemented, for without it, performing multiple transactions offline is an exercise in wasted time.

Footnotes

  1. rpmfusion.org/Howto/Multimedia

@m-blaha
Copy link
Member

m-blaha commented Mar 10, 2025

This seems like a use-case for the "do" command - currently exists as a draft PR - #2089
Although there still will only be one offline transaction, with do --offline command it can contain multiple install/remove/upgrade operations.

@RokeJulianLockhart
Copy link
Author

Although there still will only be one offline transaction

@m-blaha, do you mean that everything shall need to be defined in one command, or that _execute shall execute everything staged in a single reboot, in that special SystemD state? If the latter, that's what I desire.

Additionally, have you any idea what the proposed syntax would be? I've read #1223 (comment), but it's rather too project-specific for a lay man like me to comprehend. I've a mind to mark this issue as a duplicate of it, if you agree that it is.

@m-blaha
Copy link
Member

m-blaha commented Mar 10, 2025

I guess the former one. There still will be only one offline transaction prepared and later executed after dnf offline reboot.
But the transaction would be prepared using a command like dnf do --action=upgrade @multimedia --action=remove mesa-va-drivers mesa-vdpau-drivers --action=install mesa-va-drivers-freeworld mesa-vdpau-drivers-freeworld --offline.

So this is definitely not a duplicate of #1223 .

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

No branches or pull requests

2 participants