2012-04-20 75 views
0

我想升級我的安裝組件,以這樣的方式,那也只是specfied文件被替換和結構不會改變rpm要使用的U選項?

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 

我需要防止刪除所有舊版本的包,和剛剛更換存在的新文件

回答

1

新的rpm必須包含所有文件,而不僅僅是要更新的文件。如果列出文件爲%config(noreplace),則在更新期間它們不會被替換,而是如果安裝的文件已更改,則將在安裝更新的rpm之後創建X.rpmnew文件。換句話說你的CDA.spec應該有:

... 
%files 
... 
%config(noreplace) /opt/CDA/agent/conf/agent.ini # similar for other config files 
... 
+0

謝謝,是否有可能適用於(文件只)文件 – anish 2012-04-25 04:23:08