4.2. 使用 reposync 同步 RPM 仓库
要执行 reposync,您需要一个可以访问互联网的 RHEL 主机。同步仓库后,您可以将仓库移到从 Web 服务器托管的断开连接的网络中。
流程
附加 BaseOS 和 AppStream 所需的软件仓库:
subscription-manager repos \ --enable rhel-8-for-x86_64-baseos-rpms \ --enable rhel-8-for-x86_64-appstream-rpms
# subscription-manager repos \ --enable rhel-8-for-x86_64-baseos-rpms \ --enable rhel-8-for-x86_64-appstream-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 执行 reposync :
dnf install yum-utils reposync -m --download-metadata --gpgcheck \ -p /path/to/download
# dnf install yum-utils # reposync -m --download-metadata --gpgcheck \ -p /path/to/download
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
请确定您在使用 reposync 时带有
--download-metadata
且没有--newest-only
。请参阅 [RHEL 8] Reposync. -
如果没有使用
--newest-only
,则下载的仓库大小约为 ~90GB。 -
如果使用
--newest-only
,则下载的仓库大小约为 ~14GB。
-
请确定您在使用 reposync 时带有
如果您计划使用 Red Hat Single Sign-On (RHSSO),则需要同步这些仓库。
- jb-eap-7.3-for-rhel-8-x86_64-rpms
- rh-sso-7.4-for-rhel-8-x86_64-rpms
- 在 reposync 完成后,您的软件仓库就可以与 web 服务器一起使用。
- 将仓库移到断开连接的网络中。