Bug 963137

Summary: [rfe] perform complex packaging operations as a CLI user
Product: [Fedora] Fedora Reporter: Rahul Sundaram <metherid>
Component: dnfAssignee: Radek Holy <rholy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: admiller, akozumpl, aliakc, dan.mashal, goeran, jzeleny, lnie, praiskup, spetreolle, terje.rosten, tn
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-0.4.9-1.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-14 02:45:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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. 

Examples:

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 
https://fedoraproject.org/w/index.php?title=Features/ReplaceMySQLwithMariaDB#Steps_to_replace_MySQL_with_the_new_MariaDB_for_testing_purposes_in_Fedora_17_and_18

another at 

http://wiki.rsyslog.com/index.php/Install_rsyslog_with_yum

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.

              Examples:

              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.
https://admin.fedoraproject.org/updates/dnf-0.4.9-1.fc20

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:
https://admin.fedoraproject.org/updates/FEDORA-2013-22638/dnf-0.4.9-1.fc20
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:

http://dnf.readthedocs.org/en/latest/cli_vs_yum.html#packages-replacement-without-yum-shell-or-yum-swap

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. ***