0

i want to upgrade my install component, in such a way,that only only specfied files get replaced and the structure will not changed

rpm -qlp CDA-4.2.1-201203020211.i386.rpm 
/opt/CDA/agent/bin/agent_client
/opt/CDA/agent/bin/Agent
/opt/CDA/agent/bin/cda_agent
/opt/CDA/agent/conf/agent.conf
/opt/CDA/agent/conf/agent.ini


 rpm -qlp CDA-4.2.1.1-201203020211.i386.rpm 
 /opt/CDA/agent/bin/Agent




   installed component CDA-4.2.1-201203020211.i386.rpm   
       when i do rpm -U  CDA-4.2.1.1-201203020211.i386.rpm 
          all the files get remvoved excpet /opt/CDA/agent/bin/Agent, 
        i'm struggling with the right rpm -U addional options,
         i want only /opt/CDA/agent/bin/Agent to be replaced

i need to prevent Erasing all older versions of the package, and just replaced the new files that exists

anish
  • 6,884
  • 13
  • 74
  • 140

1 Answers1

1

New rpm has to contain all files, not just files to be updated. If you list files as %config(noreplace) they will not be replaced during update but instead if the files installed have changed a X.rpmnew files will be created after installing updated rpm. In other words your CDA.spec should have:

...
%files
...
%config(noreplace) /opt/CDA/agent/conf/agent.ini # similar for other config files
...
Stan
  • 2,487
  • 18
  • 27