Bug 963137 - [rfe] perform complex packaging operations as a CLI user
Summary: [rfe] perform complex packaging operations as a CLI user
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf   
(Show other bugs)
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Radek Holy
QA Contact: Fedora Extras Quality Assurance
: 1126078 1209648 1243141 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2013-05-15 08:39 UTC by Rahul Sundaram
Modified: 2017-08-01 11:48 UTC (History)
11 users (show)

Fixed In Version: dnf-0.4.9-1.fc20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-12-14 02:45:09 UTC
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Rahul Sundaram 2013-05-15 08:39:52 UTC
Description of problem:

yum shell is quite useful when you want to combine operations that cannot be done via the command line. the most common case is adding a package and removing another in a single transaction when there are package conflicts. 


remove fedora-bookmarks and install astronomy-bookmarks in a single transaction since both conflict with each other and has a virtual provide of system-bookmarks which is a dependency of other packages. 

a similar case is at 

another at 


Comment 1 Ales Kozumplik 2013-05-15 09:13:55 UTC
I was kind of hoping we might get rid of yum shell, but these cases you mention do exist in real life. I'll keep this bug open as a general RFE for a way to perform operations like that.

Comment 2 Rahul Sundaram 2013-05-15 15:11:07 UTC
I am fine without yum shell as long as the important use cases are handled. this is the reason I provided some references to things that are not possible without the shell (assuming you don't use nodeps or whatever).

Comment 3 Ales Kozumplik 2013-11-27 14:22:50 UTC
Radek, please handle this. DNF is going to provide something like 'yum shell' was. Basically, it's a way to let people do erase A and install B in one step so that erasing A doesn't take away all deps on it even though the provides would later be satisfied by B.

For start let's just have it very simple: install, erase, run. The implementation should use the public API where possible though for e.g. CLI parts this won't be achievable yet.

Comment 4 Radek Holy 2013-12-02 15:59:36 UTC
Added as new "--allowerasing" switch by b9a7210db919fbf11f5281ed6c966b7446412eb0 on master.
So, "dnf --allowerasing install" command now detects any conflicting packages and suggests erasing them during the same transaction. It should cover all cases you have described and the heavyweight shell still would not be needed.

Comment 5 Rahul Sundaram 2013-12-02 18:36:16 UTC
I would strongly suggest calling it --removeconflicts instead of --allowerasing which is very ambigious.

Comment 6 Rahul Sundaram 2013-12-02 18:39:40 UTC
Also note that a more generic form is already implemented in yum.  From man yum

 swap   At it's simplest this is just a simpler way to remove one set of
              package(s) and install another set of package(s) without  having
              to  use  the "shell" command.  However you can specify different
              commands to call than just remove or install, and you  can  list
              multiple  packages (it splits using the "--" marker).  Note that
              option parsing will remove the first "--" in an argument list on
              the command line.


              swap foo bar
              swap -- remove foo -- install bar
              swap foo group install bar-grp
              swap -- group remove foo-grp -- group install bar-grp

Comment 7 Terje Røsten 2013-12-02 19:31:59 UTC
Will this cover multiple packages on the install side? Just asking.

Comment 8 Terje Røsten 2013-12-02 21:13:27 UTC
Yeah, seems to work as needed, thanks!

Comment 9 Radek Holy 2013-12-03 08:32:09 UTC
Terje, yes, it should work with multiple packages.
Rahul, the switch generally allows erasing of packages while resolving dependencies. In your use cases, it works as I have described, in other cases, it simply allows erasing as a possible operation during the dependency resolution.

Comment 10 Fedora Update System 2013-12-03 16:39:45 UTC
dnf-0.4.9-1.fc20 has been submitted as an update for Fedora 20.

Comment 11 Fedora Update System 2013-12-03 18:20:29 UTC
Package dnf-0.4.9-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-0.4.9-1.fc20'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 12 lnie 2013-12-05 06:24:38 UTC
tested with 0.4.9-1.fc20,dnf --allowerasing works fine

Comment 13 Ales Kozumplik 2013-12-05 13:10:47 UTC
*** Bug 1038504 has been marked as a duplicate of this bug. ***

Comment 14 Fedora Update System 2013-12-14 02:45:09 UTC
dnf-0.4.9-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 15 Ales Kozumplik 2014-08-14 07:15:54 UTC
*** Bug 1126078 has been marked as a duplicate of this bug. ***

Comment 16 Radek Holy 2015-04-08 06:46:33 UTC
*** Bug 1209648 has been marked as a duplicate of this bug. ***

Comment 17 Ali Akcaagac 2015-04-08 07:23:24 UTC
As a reference to https://bugzilla.redhat.com/show_bug.cgi?id=1209648

I was requesting the exact "swap" feature as it exists in yum. Not a different (or slightly different) approach with different command set. Please keep in mind that dnf replaced yum and I (and other people as well) probably rely on an equal command set doing the same tasks as yum did.

Therefore please!

yum swap -- autoremove somepackage -- install somepackage

I rely on exact command parameters. Our infrastructure is not a play toy that can easily be replaced over night. Everything is documented and works for quite some time now.

Pointing me to:


Was clearly not what I was asking for.

Comment 18 Radek Holy 2015-04-08 07:37:25 UTC
I apologize, I probably misunderstood "I don't see how to achieve this task once we switch to Fedora 22." then. OK, your comment reminds me the discussion in bug 1110780.

Comment 19 Ali Akcaagac 2015-04-08 08:30:46 UTC
(In reply to Radek Holy from comment #18)
> I apologize, I probably misunderstood "I don't see how to achieve this task
> once we switch to Fedora 22." then.
It means, that *I* might be in trouble once *I* switch to Fedora 22.

Let's assume this:

There is a company/organisation/entity that decided to switch from Fedora 20 to 22 once it is out. Besides new tools there is an expectation that basic things are working more or less the same way. Things like yum is to be expected to be the same.

I heard about dnf for quite some time now (you can't get past it if you use Fedora. You do hear about it quite often). Now with the deprecation of yum (pointing to dnf) I do run in trouble because I have set up *and written* an infrastructure around yum to achieve some tasks that I need in my workflow.

I really like to switch and have only *small* changes to the infrastructure at all (in best condition I won't want to touch it at all). Sadly the two major command set that I rely on are missing.

yum swap
yum --downloadonly and --downloaddir

It's not just about adding some "alias" it's the exact behaviour that I like to expect from these command lines.

I can not speak for the other bug report but the person in charge might have valid reasons for expressing his concerns.

Comment 20 Ali Akcaagac 2015-04-08 08:56:29 UTC
Why has this been closed ? The work flows are valid concerns.

Comment 21 Radek Holy 2015-07-15 06:06:19 UTC
*** Bug 1243141 has been marked as a duplicate of this bug. ***

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