CentOS 6.x 本地yum源配置與使用
系統默認已經安裝了可使用yum的軟件包,所以可以直接配置:
# mount /dev/cdrom /mnt 掛載鏡像,可以寫到配置文件,開機自動掛載
# echo "mount /dev/cdrom /mnt" >> /etc/rc.local
# cd /etc/yum.repos.d/ yum源配置文件放置目錄
# mv CentOS-Base.repo CentOS-Base.repo.bak 先將網絡yum源的配置文件更名(讓其失效)
# vim CentOS-yf.repo 編輯本地yum源文件
[CentOS]
name=CentOS-yum 本地yum源名稱(可隨意修改)
baseurl=file:///mnt/ 光盤掛載目錄/mnt/sr0
gpgcheck=1
enabled=1 使用此yum源(等於0為不啟用)
gpgkey=file:///mnt/sr0/RPM-GPG-KEY-CentOS-6 本地yum源密鑰
#yum clean all
執行 yum list 檢測是否可用
CentOS 6.x 本地yum源配置與使用