← Back to team overview

ius-community team mailing list archive

Re: yum swap

 

Hi,

I think the IUS plugin has some good advantages over yum swap, like being able to detect replacements in more than just the packages referenced on the command-line

e.g. where yum swap you have to do:
> yum swap -- remove php{,-cli,-common,-pecl-xdebug} -- install php56u{,-cli,-common,-pecl-xdebug}

whereas you can do functionally the equivalent using the following with yum-plugin-replace:

yum replace php-common —replace-with=php56u-common

If you were to automate the yum swap without verification, if you had say php-pecl-memcached installed, yum swap wouldn’t automatically detect the php56u-pecl-memcached version, and would uninstall php-pecl-memcached.

This only really works in yum-plugin-replace because assumptions are made regarding package naming though (i.e. the package name is just switching the prefix with the name of the name SRPM package), and there’s definitely some cases yum swap is better suited e.g. replacing mysql-libs with mysql55-libs, which by itself doesn’t satisfy other installed packages dependencies, so yum replace won’t work (although could easily be resolved by mysql55-libs requiring mysqlclient15/16 depending on Redhat version).

With yum swap, you’d be able to instead do:

yum swap — remove mysql-libs — install mysql55-libs mysqlclient16

I’ve previously had to write Chef recipes to do this using piping commands to yum shell stdin.

Regards

Andy

> On 16 Dec 2014, at 20:38, Carl George <carl.george@xxxxxxxxxxxxx> wrote:
> 
> Howdy IUS community,
> 
> Today I was reading about upcoming changes in dnf [0], and I stumbled across a current feature of yum I had not seen before called "swap".  It is available on RHEL/Centos 7.  From the man page:
> 
>    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.
> 
> Here are some IUS-specific examples.
> 
>    yum swap rsync rsync31u
>    yum swap -- remove php{,-cli,-common} -- install php56u{,-cli,-common}
> 
> After some basic testing this functionality seems robust and easy to use.  We currently maintain the yum-plugin-replace package [1].  The yum swap command appears to have the potential to obsolete this plugin on EL7.  Since the feature doesn't exist on EL5 or EL6, we would of course continue to maintain the plugin for those releases.
> 
> Has anyone used yum swap before?  Has anyone run into issues with it?  We are considering updating our documentation to make this the recommended method for installing IUS packages on EL7.
> 
> - Carl
> 
> [0] http://dnf.readthedocs.org/en/latest/cli_vs_yum.html#packages-replacement-without-yum-shell-or-yum-swap
> [1] https://iuscommunity.org/pages/IUSClientUsageGuide.html#upgrading-stock-rhel-packages-to-ius-packages
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~ius-community
> Post to     : ius-community@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~ius-community
> More help   : https://help.launchpad.net/ListHelp



References