RHEL7.0安装初始默认没有任何yum 源,以挂载本地DVD到/mnt/cdrom,将系统yum源连接到/mnt/cdrom为例。
# 用yum-config-manager生成一个源文件模版
[root@server0 yum.repos.d]# yum-config-manager –add-repo=cdrom
Loaded plugins: langpacks, product-id
adding repo from: cdrom
[cdrom]
name=added from: cdrom
baseurl=cdrom
enabled=1
# 将生成的模版编辑如下
[root@server0 yum.repos.d]# cat cdrom.repo
[cdrom]
name=DVD Media
baseurl=file:///mnt/cdrom
enabled=1
# 挂载CDROM
[root@server0 yum.repos.d]# mount /dev/cdrom /mnt/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
# 导入RPM-GPG-KEY
[root@server0 yum.repos.d]# rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-xxxx
# 查看
[root@server0 ~]# yum repolist
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id repo name status
cdrom DVD Media 4,305
repolist: 4,305
更多YUM相关教程见以下内容:
RedHat 6.2 Linux修改yum源免费使用CentOS源 http://www.linuxidc.com/Linux/2013-07/87383.htm
配置EPEL YUM源 http://www.linuxidc.com/Linux/2012-10/71850.htm
Redhat 本地yum源配置 http://www.linuxidc.com/Linux/2012-11/75127.htm
yum的配置文件说明 http://www.linuxidc.com/Linux/2013-04/83298.htm
RedHat 6.1下安装yum(图文) http://www.linuxidc.com/Linux/2013-06/86535.htm
YUM 安装及清理 http://www.linuxidc.com/Linux/2013-07/87163.htm
CentOS 6.4上搭建yum本地源 http://www.linuxidc.com/Linux/2014-07/104533.htm
更多RedHat相关信息见RedHat 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=10
展开全文
本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-12/1260.htm