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万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章