1. 程式人生 > >rpm包安裝時如何更新安裝路徑?

rpm包安裝時如何更新安裝路徑?

如果rpm包已經做好,但在安裝的時候想修改預設路徑,則可以:

rpm -ivh --prefix=/opt/usr xxx.rpm
又或者同時修改多個路徑:

rpm -ivh --relocate=/usr=/opt/usr --relocate=/etc=/usr/etc xxx.rpm

檢視一個未安裝的rpm包中包含那些檔案:

rpm -qlp ****.rpm 

rpm -ivh [install_options] package 
以下的options是可完成: 
        --prefix <path>; 
               This   sets   the   installation   prefix to <path>; for 
               relocatable packages. 

        --relocate <oldpath>;=<newpath>; 
               For relocatable packages, translates the files that 
               would be put in <oldpath>; to <newpath>;. 

        --badreloc 
               To   be   used   in   conjunction with --relocate, this 
               forces the relocation even   if   the   package   isn't 
               relocatable. 

        --noorder 
               Don't reorder the packages for an install. The list 
               of packages would normally be reordered to   satisfy 
               dependancies.