CentOS獲取FetchLinux的步驟
在獲取FetchLinux前,需確保系統已更新并安裝關鍵工具(如git、wget等)。打開終端執行以下命令:
sudo yum update -y && sudo yum install -y git wget curl openssh-server
FetchLinux的代碼托管在GitHub,通過git克隆倉庫到本地(推薦路徑為/opt/fetchlinux,便于系統管理):
git clone https://github.com/fetchlinux/fetchlinux.git /opt/fetchlinux
進入倉庫目錄,復制配置文件模板并根據需求修改(如設置鏡像URL、更新頻率等):
cd /opt/fetchlinux
sudo cp fetchlinux.conf.example fetchlinux.conf
sudo nano fetchlinux.conf # 編輯配置(示例:REPOSITORY_URL="http://your-mirror-url/fetchlinux")
為安全起見,創建專用用戶fetchlinux及同組,并修改倉庫目錄所有權:
sudo groupadd fetchlinux
sudo useradd -r -g fetchlinux fetchlinux
sudo chown -R fetchlinux:fetchlinux /opt/fetchlinux
若FetchLinux提供systemd服務(部分版本支持),啟用并啟動服務以實現開機自啟:
sudo systemctl enable fetchlinux
sudo systemctl start fetchlinux
通過以下命令驗證安裝是否成功,并查看可用功能:
fetchlinux --help # 查看命令幫助
fetchlinux --version # 查看版本信息(若支持)
yum/dnf或第三方工具(如wget、curl);若需自動化更新,可配置yum-cron或dnf-automatic。