How to replace one package with another using yum?

21,997

Try using YUM's shell transactions:

# yum shell
>
> remove <package>
> repo disable <repo ID of not required package>
> install <package>
> run
> exit
Share:
21,997

Related videos on Youtube

Deer Hunter
Author by

Deer Hunter

Updated on September 18, 2022

Comments

  • Deer Hunter
    Deer Hunter over 1 year

    I must be missing something obvious here. If there are two equally versioned RPM packages of the same software product, with one of them installed on one of my rigs (with a metric tonne of packages as dependencies), how can I replace it with another without going through the hassle of erasing and reinstalling an insane number of dependent packages?

    I'd like to do it via yum. rpm-based solutions (with forcing) are grudgingly accepted.

  • Deer Hunter
    Deer Hunter over 9 years
    Brilliant! (extra characters added)
  • Deer Hunter
    Deer Hunter over 9 years
    Also possible to do: yum swap -- remove foo -- install bar (not tested).
  • HeroFromEarth
    HeroFromEarth almost 5 years
    @DeerHunter, yum in CentOS 6 doesn't have 'swap' command. garethTheRed's answer works on CentOS 6 too