Bug 1934883 - [RFE] dnf: swap more than two packages in one transaction
Summary: [RFE] dnf: swap more than two packages in one transaction
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: dnf-community
TreeView+ depends on / blocked
 
Reported: 2021-03-03 22:49 UTC by Carl George 🤠
Modified: 2023-08-09 23:53 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-09 20:11:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Carl George 🤠 2021-03-03 22:49:47 UTC
Description of problem:
`yum swap` allowed swapping more than two packages using `--` as a delimiter between the packages to remove and the packages to install.  This no longer works with `dnf swap`.


Version-Release number of selected component (if applicable):
dnf-4.6.0-1.fc34.noarch


How reproducible:
always


Steps to Reproduce:
(the exact packages don't matter, these were picked at random)
1. dnf install color-filesystem emacs-filesystem
2. dnf swap -- color-filesystem emacs-filesystem -- kde-filesystem mesa-filesystem


Actual results:
dnf swap: error: unrecognized arguments: kde-filesystem mesa-filesystem


Expected results:
Uninstall of color-filesystem and emacs-filesystem, install of kde-filesystem and mesa-filesystem.


Additional info:
`dnf shell` can also be used to accomplish this task, but that requires interactive input, a separate file, or shell redirection.  `dnf swap` is an easy and convenient way to perform transactions like this in a single command non-interactively.  It is especially useful when building container images.

Comment 1 Neal Gompa 2021-03-03 23:00:34 UTC
This is similar to bug 1403465, though this one talks about restoring functionality that YUM previously had, and that bug talked about adding *new* syntax to support this.

Comment 2 Jaroslav Mracek 2023-08-09 20:11:02 UTC
I suggest that package swap is required when packages conflicts - what about to use `dnf install <args> --allowerasing`. This was the original replacement of swap and shell ind dnf. Due to presence of workarounds I am closing the issue.

Comment 3 Carl George 🤠 2023-08-09 23:53:48 UTC
`dnf install <args> --allowerasing` is great when conflicts exist in the packages.  It doesn't help when you need to swap sets of multiple packages which do not conflict, which yum allowed you to do.  I understand if the final answer is WONTFIX, but it's still a regression.

Is that WONTFIX decision for dnf4 and dnf5, or dnf4 only?


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