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.


1 Answer 1


Try using YUM's shell transactions:

# yum shell
> remove <package>
> repo disable <repo ID of not required package>
> install <package>
> run
> exit
  • Brilliant! (extra characters added) Oct 1, 2014 at 9:16
  • 5
    Also possible to do: yum swap -- remove foo -- install bar (not tested). Oct 1, 2014 at 9:21
  • @DeerHunter, yum in CentOS 6 doesn't have 'swap' command. garethTheRed's answer works on CentOS 6 too Jun 26, 2019 at 12:45

Not the answer you're looking for? Browse other questions tagged .