MySQL社区

标题: rhel6添加本地yum [打印本页]

作者: jeff    时间: 2015-10-15 14:27
标题: rhel6添加本地yum
1、准备工作
关闭selinux
  1. #setenforce 0
复制代码
创建yum目录
  1. #mkdir /yum
复制代码
挂载光盘
  1. #mount -o loop /dev/cdrom /mnt
复制代码
拷贝光盘内所有文件到本地目录
  1. #cp -ar /mnt/* /yum
复制代码

2、添加配置文件
修改repo文件,访问本地yum库
  1. #vi /etc/yum.repos.d/local.repo
复制代码
[local]
name=Red Hat Enterprise Linux update6
baseurl=file:///yum/
gpgcheck=0
enabled=1

删除或者备份原始repo文件,否则yumlist会报错如下:

  1. <blockquote>#mv /etc/yum.repos.d/packagekit-media.repo /etc/yum.repos.d/packagekit-media.repo.bk
复制代码
清除yum缓存
  1. #yum clean all
复制代码

3、测试

[root@rhel6 ~]# yum repolist
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
repo id repo name status
local Red Hat Enterprise Linux update6 3,391
repolist: 3,391

看到上述信息,表示yum库创建成功。

转载自:http://www.ttlsa.com/linux/rhel6-local-yum-repository/






欢迎光临 MySQL社区 (http://www.mysqlpub.com/) Powered by Discuz! X3.2