Description of problem: Yum swap supports installing and removing packages and groups as a single command. "Examples: swap foo bar swap -- remove foo -- install bar swap foo group install bar-grp swap -- group remove foo-grp -- group install bar-grp " This is quite handy especially when you are replacing one package with another with similar files/functionality (ex) sendmail with postfix Similar request https://unix.stackexchange.com/questions/39887/is-there-a-way-to-install-and-remove-packages-in-a-single-yum-command
Rahul, if you are not again duplicating some of your requests, can you provide us a common use case where the '--allowerasing' switch is not enough? We do not add new commands just because someone thinks it might become handy sometimes in the future as it was already explained to you.
The example I showed is directly from yum man page (which came from in part from discussions with Seth Vidal earlier) so I am kinda duplicating myself anyway to avoid losing features I find convenient in the transition from yum to dnf. Having said that, --allowerasing doesn't allow you to install and remove packages and groups when there are no conflicts. Use cases: A) I build images (CI/CD) where I need to install packages and groups and remove others and in conjunction with the RFE to clean cache immediately (1148674), I can do everything I need in a single transaction which is convenient (vagrant, docker files etc) B) Fedora user installs group A and decides to remove it and install group B instead (think of switching from one desktop environment to another as one possibility here). The user is already aware that there a bunch of common dependencies between these groups but if you had installed packages together, dnf removes them together by default as well (since clean_requirements_on_remove is enabled by default) but doing them in a single transaction would avoid having to remove packages only to install them immediately after. Hope that helps.
If there are no conflicts, you can simply run "dnf install bar;dnf erase foo".
Alteast with yum, there was a significant performance improvement when doing it as a single transaction especially with large dependencies.
Yum being slow at something doesn't make for a good reason to do something in dnf.
Sure, what I was getting at is that if dnf developers believe there is no significant difference in performance with dnf, there perhaps it won't be needed.
Well, I think there cannot be a performance improvement in the case A. You still have to run "dnf swap foo bar" or "dnf erase foo" (appending the bar to the antecedent installation). And I think that the use case B is not common enough to make a potential performance improvement (if it would be an improvement) so significant to justify a new command that will need to be maintained then. Anyway, this seems to be a duplicate of 1110780 in which you are involved too. It depends whether the reporter meant conflicting or non-conflicting packages.
Still `--allowerasing` seems to me more simple especially for user who doesn't look deeply into relation of packages. *** This bug has been marked as a duplicate of bug 1110780 ***