Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

使用 rpm --relocate 參數自訂 RPM 套件安裝路徑

編輯:關於 Linux

預設安裝路徑查詢

rpm -qpl package.rpm

輸出範例:

/usr/bin/ext3grep
/usr/share/doc/ext3grep-0.10.0/INSTALL
...

指定安裝目錄

rpm -i --relocate /usr/bin=/home/easwy/bin \
       --relocate /usr/share/doc=/home/easwy/doc \
       ext3grep-0.10.0-1.el5.rf.i386.rpm

套件將安裝至 /home/easwy/bin 與 /home/easwy/doc。

適用場景

無 root 權限、不想汙染系統目錄、或需多版本共存時極為實用。

結語

--relocate 讓 RPM 安裝路徑彈性配置,解決權限不足或自訂部署需求。

Copyright © Windows教程網 All Rights Reserved