Bug 1149014 - [rfe] install and remove together
Summary: [rfe] install and remove together
Keywords:
Status: CLOSED DUPLICATE of bug 1110780
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-02 23:07 UTC by Rahul Sundaram
Modified: 2014-10-03 15:45 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-10-03 15:45:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Rahul Sundaram 2014-10-02 23:07:58 UTC
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

Comment 1 Radek Holy 2014-10-03 10:56:59 UTC
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.

Comment 2 Rahul Sundaram 2014-10-03 11:23:52 UTC
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.

Comment 3 Radek Holy 2014-10-03 11:34:17 UTC
If there are no conflicts, you can simply run "dnf install bar;dnf erase foo".

Comment 4 Rahul Sundaram 2014-10-03 11:39:49 UTC
Alteast with yum, there was a significant performance improvement when doing it as a single transaction especially with large dependencies.

Comment 5 Panu Matilainen 2014-10-03 11:48:12 UTC
Yum being slow at something doesn't make for a good reason to do something in dnf.

Comment 6 Rahul Sundaram 2014-10-03 12:04:13 UTC
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.

Comment 7 Radek Holy 2014-10-03 12:31:52 UTC
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.

Comment 8 Honza Silhan 2014-10-03 15:45:44 UTC
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 ***


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