码迷,mamicode.com
首页 > 其他好文 > 详细

Centos6.5使用光盘作为本地的yum源

时间:2016-06-27 17:57:45      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:本地   centos6.5   yum   

Centos6.5使用光盘作为本地的yum源

主要是用于无法连接外网的CentOS6.5服务器


mkdir /mnt/cdrom

挂载光驱ISO文件 


[root@www~]# mount /dev/cdrom /mnt/cdrom/

修改默认的源,修改前请先备份文件。

[root@www ~]# cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak


编辑yum文件


[root@www ~]# vim /etc/yum.repos.d/CentOS-Base.repo

[base]

name=CentOS-$releasver - Base

baseurl=file:///mnt/cdrom/

gpgcheck=1

enabled=1

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


#released updates

[updates]

name=CentOS-$releasver - Updates

baseurl=file:///mnt/cdrom/

gpgcheck=1

enabled=1

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

...


[root@localhost ~]# yum clean all (清除缓存)

[root@localhost ~]# yum makecache (建立新缓存)


就可以了的说


本文出自 “KKMM” 博客,请务必保留此出处http://lisiyun.blog.51cto.com/2779132/1793213

Centos6.5使用光盘作为本地的yum源

标签:本地   centos6.5   yum   

原文地址:http://lisiyun.blog.51cto.com/2779132/1793213

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!