自定義FetchDebian設置主要通過編輯配置文件和命令行參數實現,具體方法如下:
編輯配置文件
配置文件路徑為/etc/fetchdebian.conf
,使用文本編輯器(如nano
)修改以下選項:
mirror
:設置鏡像源,如https://deb.debian.org/debian/
。distribution
:指定Debian版本(如buster
、bullseye
)。components
:選擇軟件包組件(如main contrib non-free
)。architectures
:設置目標架構(如amd64
、arm64
)。output
:指定下載文件輸出目錄,如/var/cache/fetchdebian
。threads
:設置下載線程數(可選)。使用命令行參數
在命令中直接指定選項,覆蓋配置文件中的設置:
-d/--directory
:指定下載目錄。-b/--binary
:僅下載二進制文件。-s/--source
:僅下載源代碼。--no-check-gpg
:跳過GPG簽名檢查。--exclude
:排除指定軟件包。示例
nginx
二進制包到自定義目錄:fetchdebian -b nginx -d /custom/path
。bullseye
版本的main
組件到指定鏡像:mirror=https://mirror.example.com/debian/
,distribution=bullseye
,components=main
,然后運行sudo fetchdebian update
。注意:部分選項(如安裝路徑)需結合dpkg
等工具手動處理,FetchDebian主要用于下載,安裝路徑通常由系統默認管理。
參考來源: