欢迎光临
我们一直在努力

rhel6添加本地yum

1、准备工作

关闭selinux

#setenforce 0

创建yum目录

#mkdir /yum

挂载光盘

#mount -o loop /dev/cdrom /mnt

拷贝光盘内所有文件到本地目录

#cp -ar /mnt/* /yum

2、添加配置文件

修改repo文件,访问本地yum库

#vi /etc/yum.repos.d/local.repo

[local]
name=Red Hat Enterprise Linux update6
baseurl=file:///yum/
gpgcheck=0
enabled=1

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

#mv /etc/yum.repos.d/packagekit-media.repo /etc/yum.repos.d/packagekit-media.repo.bk
rhel6 Error: Cannot retrieve repository metadata (repomd.xml) for repository: InstallMedia. Please verify its path and try again

清除yum缓存

#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库创建成功

赞(0) 打赏
主机商所有内容均来自网络,若无意侵犯到您的权利,请及时与联系 QQ 2232175042,将在48小时内删除相关内容!!主机测评网 » rhel6添加本地yum

主机商评测网 找服务器 更专业 更方便 更快捷!

专注IDC行业资源共享发布,给大家带来方便快捷的资源查找平台!

联系我们

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫