吆嘻!
分类: LINUX
2012-07-13 12:19:27
[base]
name=CentOS-5 - Base
baseurl=
gpgcheck=1
gpgkey=
#released updates
[update]
name=CentOS-5 - Updates
baseurl=
gpgcheck=1
gpgkey=
#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
baseurl=
gpgcheck=1
gpgkey=
#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
baseurl=
gpgcheck=1
gpgkey=
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
baseurl=
gpgcheck=1
enabled=0
gpgkey=
#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
baseurl=
gpgcheck=1
enabled=0
gpgkey=
=======================================
测试yum是否成功:
yum makecache 以后
RHEL6搭建本地yum源
1、 建立本地yum源目录
mkdir /yumsource
2、 Copy光盘内容到yum源目录
cp –a /mnt/* /yumsource
3、 创建本地yum源的repo文件
vi /etc/yum.repos.d/local.repo
4、 修改yumRepo.py文件
vi /usr/lib/python2.6/site-packages/yum/yumRepo.py
把782行由
remote = url + '/' + relative
改为
remote = url + '/yumsource' + relative
5、 清理yum
yum clean all
6、 大功告成
yum list
yum grouplist
应该能看到yum查询到的本地yum源信息
RHEL5.x搭建本地yum源
创建链接文件:
[root@kaijun ~]# ln -s /media/RHEL_5.3\ i386\ DVD/Server/ /Server
创建、修改配置文件:
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]#
[root@localhost yum.repos.d]# cp rhel-debuginfo.repo core.repo
[root@localhost yum.repos.d]# vim core.repo //core任意名
添加下面几行代码在后面
[core]
name=core
baseurl=file:///Server
enabled=1
gpgcheck=0
[root@localhost ~]#yum clean
[root@localhost ~]#yum list
大功告成
转载
http://hi.baidu.com/496809502/blog/item/5c272e161b618ddbc3fd788a.html
收藏:http://www.cnblogs.com/jifeng/archive/2010/08/26/1809566.html