使用FetchDebian管理Debian軟件源步驟如下:
安裝FetchDebian
sudo apt update && sudo apt install fetchdebian
配置軟件源
/etc/fetchdebian.conf,設置鏡像站點、發行版版本、組件、架構等參數,例如:mirror = "https://deb.debian.org/debian/"
suite = "bullseye"
components = "main contrib non-free"
architectures = "amd64"
output = "/var/cache/fetchdebian"
/etc/apt/sources.list或/etc/apt/sources.list.d/fetchdebian.list)指定FetchDebian源。同步軟件源
運行命令同步軟件包和依賴項到本地緩存:
sudo fetchdebian update
更新系統軟件
同步后,使用APT命令更新系統:
sudo apt full-upgrade
定期同步(可選)
可通過cron定時任務自動同步,例如每天凌晨2點執行:
sudo crontab -e
# 添加以下行
0 2 * * * /usr/bin/fetchdebian update
說明:FetchDebian主要用于下載軟件包或同步倉庫,實際系統升級仍需依賴APT工具。