无来

不管你来还是不来
我都在这里,夜夜点亮
不是为了守候
只是为了做好我自己

0%

centos 6.5 把光盘设置为本地yum源

为了搞学习内核编译,需要安装一些开发工具包,索性把光盘镜像设置成本地yum源,这样更快些!以下是一些基本步骤:

  • 1、 首先挂载光盘到/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、新建一个光盘源

vim CentOS-Media.repo

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 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 (建立新缓存)