centos使用本地源方法

被安排去安裝centos的服務器,但是卻沒有網絡。

幸好還有之前的光盤鏡像,果斷 mount -o loop -t iso9660 /root/source_package/CentOS-6.5-x86_64-bin-DVD1.iso CentOs-6.5-CD1/

然後修改文件如下


[root@localhost ~]# cat /etc/yum.repos.d/CentOS-Media.repo

# CentOS-Media.repo
#
#  This repo can be used with mounted DVD media, verify the mount point for
#  CentOS-6.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
#  yum --enablerepo=c6-media [command]
#
# or for ONLY the media repo, do this:
#
#  yum --disablerepo=\* --enablerepo=c6-media [command]


[c6-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
        file:///media/CentOs-6.5-CD1/
        file:///media/CentOs-6.5-CD2/
        file:///media/cdrecorder/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
發佈了75 篇原創文章 · 獲贊 2 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章