天天看點

centos 6.5 把CD光牒設定為本地yum源

    為了搞學習核心編譯,需要安裝一些開發工具包,索性把CD光牒鏡像設定成本地yum源,這樣更快些!以下是一些基本步驟:

   1、首先挂載CD光牒到/mnt/cd下,mount  /dev/cdrom  /mnt/cd,這個就不多說了;

   2、 進入/etc/yum.repos.d/目錄下,把原來的yum源備份,我給它重新命名了。

          mv CentOS-Vault.repo CentOS-Vault.repo.bak

          mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.bak

           mv CentOS-Base.repo CentOS-Base.repo.bak

  3、建立一個CD光牒源

        vim  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:///mnt/cd

gpgcheck=1

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

儲存退出

4、yum clean all(清除緩存)

5、yum  makecache (建立新緩存)

繼續閱讀