title: Can yum be forced to uninstall an obsolete package before installing the new package?
body: <p>The use case is this:</p>
  
  <p>I have PkgA which is already installed.</p>
  
  <p>Now I created PkgB which obsoletes PkgA.</p>
  
  <p>In this case: yum install PkgB will do the following operations:</p>
  
  <ol>
  <li><strong>install PkgB</strong></li>
  <li><strong>uninstall PkgA</strong></li>
  </ol>
  
  <p>The problem is that in PkgA has a bug, and it when uninstalling removes a folder which contains files installed by PkgB. I cannot change the location of this file because they are needed for backwards compatibility.</p>
  
  <p>Is there a way in which I could force yum to first uninstall PkgA and then install PkgB?</p>
  
  <p>I am using CentOS Linux release 7.2.1511 (Core)</p>
  
  <p>Yum and RPM versions:</p>
  
  <p># yum --version</p>
  
  <p>3.4.3</p>
  
  <p>Installed: rpm-4.11.3-17.el7.x86_64 at 2017-06-12 21:14</p>
  
  <p>Installed: yum-3.4.3-132.el7.centos.0.1.noarch at 2017-06-12 21:14</p>
  
  <p>Installed: yum-plugin-fastestmirror-1.1.31-34.el7.noarch at 2017-06-12 21:14</p>