安装 DVD
[root@rhel66 ~]# mount /dev/sr0 /media
安装 repo 元数据
[root@rhel66 ~]# cp /media/media.repo /etc/yum.repos.d/rhel6.repo
列出存储库
[root@rhel66 ~]# yum repolist all
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id repo name status
InstallMedia Red Hat Enterprise Linux 6.6 disabled
rhel-source Red Hat Enterprise Linux 6Server - x86_64 - Source disabled
rhel-source-beta Red Hat Enterprise Linux 6Server Beta - x86_64 - Sourc disabled
repolist: 0
尝试启用 repo
[root@rhel66 ~]# yum-config-manager --enable InstallMedia
Loaded plugins: product-id
============================== repo: InstallMedia ==============================
[InstallMedia]
bandwidth = 0
base_persistdir = /var/lib/yum/repos/x86_64/6Server
baseurl =
cache = 0
cachedir = /var/cache/yum/x86_64/6Server/InstallMedia
cost = 500
enabled = True
enablegroups = True
exclude =
failovermethod = priority
gpgcadir = /var/lib/yum/repos/x86_64/6Server/InstallMedia/gpgcadir
gpgcakey =
gpgcheck = False
gpgdir = /var/lib/yum/repos/x86_64/6Server/InstallMedia/gpgdir
gpgkey =
hdrdir = /var/cache/yum/x86_64/6Server/InstallMedia/headers
http_caching = all
includepkgs =
keepalive = True
mdpolicy = group:primary
mediaid = 1411733344.627228
metadata_expire = -1
metalink =
mirrorlist =
mirrorlist_expire = 86400
name = Red Hat Enterprise Linux 6.6
old_base_cache_dir =
password =
persistdir = /var/lib/yum/repos/x86_64/6Server/InstallMedia
pkgdir = /var/cache/yum/x86_64/6Server/InstallMedia/packages
proxy = False
proxy_dict =
proxy_password =
proxy_username =
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert =
sslclientcert =
sslclientkey =
sslverify = True
throttle = 0
timeout = 30.0
username =
再次列出,仍然处于禁用状态
[root@rhel66 ~]# yum repolist all
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id repo name status
InstallMedia Red Hat Enterprise Linux 6.6 disabled
rhel-source Red Hat Enterprise Linux 6Server - x86_64 - Source disabled
rhel-source-beta Red Hat Enterprise Linux 6Server Beta - x86_64 - Sourc disabled
repolist: 0
来自文档看起来这必须可行。但 DVD 上存储的存储库仍处于禁用状态。
答案1
你必须修改复制到的文件/etc/yum.repos.d/
并添加baseurl
以 DVD 安装路径作为值的属性。
baseurl=file:///path_to_DVD/