C.2. 为 Red Hat Enterprise Linux 8 导入 Kickstart 存储库
要为 Red Hat Enterprise Linux 8 导入 Kickstart 软件仓库,请在 Satellite 上完成以下步骤。
流程
- 访问红帽客户门户网站 https://access.redhat.com/ 并登录。
- 在窗口的左上角,单击 Downloads。
- 单击 Red Hat Enterprise Linux 8。
- 在 Download Red Hat Enterprise Linux 窗口中,找到 ISO 镜像的二进制 DVD 版本,例如: Red Hat Enterprise Linux 8.1 Binary DVD,然后点 Download Now。
- 下载完成后,将 ISO 镜像复制到 Satellite 服务器。
在 Satellite 服务器上,创建一个挂载点,并将 ISO 镜像临时挂载到该位置:
# mkdir /mnt/iso # mount -o loop rhel-binary-dvd.iso /mnt/iso
为 Red Hat Enterprise Linux 8 AppStream 和 BaseOS Kickstart 软件仓库创建目录:
# mkdir --parents \ /var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/appstream/kickstart # mkdir --parents \ /var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/baseos/kickstart
从 ISO 镜像复制
kickstart
文件:# cp -a /mnt/iso/AppStream/* \ /var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/appstream/kickstart # cp -a /mnt/iso/BaseOS/* /mnt/iso/images/ \ /var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/baseos/kickstart
请注意,对于 BaseOS,还必须复制
/mnt/iso/images/
目录的内容。在列表文件中添加以下条目:
在
/var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/appstream/listing
文件中,附加带有新行的kickstart
。在
/var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/baseos/listing
文件中,附加带有新行的kickstart
:在
/var/www/html/pub/sat-import/content/dist/rhel8/listing
文件中,附加带有新行的版本号。例如,对于 RHEL 8.1 二进制 ISO,请附加8.1
。从 ISO 镜像复制
.treeinfo
文件:# cp /mnt/iso/.treeinfo \ /var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/appstream/kickstart/treeinfo # cp /mnt/iso/.treeinfo \ /var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/baseos/kickstart/treeinfo
-
打开
/var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/baseos/kickstart/treeinfo
文件进行编辑。 在
[general]
部分中,进行以下更改:-
将
packagedir = AppStream/Packages
改为packagedir = Packages
-
将
repository = AppStream
更改为repository = .
-
将
variant = AppStream
改为variant = BaseOS
-
将
变体 = AppStream,BaseOS
改为variants = BaseOS
-
将
-
在
[tree]
部分中,将variants = AppStream,BaseOS
更改为variants = BaseOS
。 在
[variant-BaseOS]
部分进行以下更改:-
将软件包
= BaseOS/Packages 更改为
packages
= Packages -
将
repository = BaseOS
更改为repository = .
-
将软件包
-
删除
[media]
和[variant-AppStream]
部分。 - 保存并关闭该文件。
验证
/var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/baseos/kickstart/treeinfo
文件是否具有以下格式:[checksums] images/efiboot.img = sha256:9ad9beee4c906cd05d227a1be7a499c8d2f20b3891c79831325844c845262bb6 images/install.img = sha256:e246bf4aedfff3bb54ae9012f959597cdab7387aadb3a504f841bdc2c35fe75e images/pxeboot/initrd.img = sha256:a66e3c158f02840b19c372136a522177a2ab4bd91cb7269fb5bfdaaf7452efef images/pxeboot/vmlinuz = sha256:789028335b64ddad343f61f2abfdc9819ed8e9dfad4df43a2694c0a0ba780d16 [general] ; WARNING.0 = This section provides compatibility with pre-productmd treeinfos. ; WARNING.1 = Read productmd documentation for details about new format. arch = x86_64 family = Red Hat Enterprise Linux name = Red Hat Enterprise Linux 8.1.0 packagedir = Packages platforms = x86_64,xen repository = . timestamp = 1571146127 variant = BaseOS variants = BaseOS version = 8.1.0 [header] type = productmd.treeinfo version = 1.2 [images-x86_64] efiboot.img = images/efiboot.img initrd = images/pxeboot/initrd.img kernel = images/pxeboot/vmlinuz [images-xen] initrd = images/pxeboot/initrd.img kernel = images/pxeboot/vmlinuz [release] name = Red Hat Enterprise Linux short = RHEL version = 8.1.0 [stage2] mainimage = images/install.img [tree] arch = x86_64 build_timestamp = 1571146127 platforms = x86_64,xen variants = BaseOS [variant-BaseOS] id = BaseOS name = BaseOS packages = Packages repository = . type = variant uid = BaseOS
-
打开
/var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/appstream/kickstart/treeinfo
文件进行编辑。 在
[general]
部分中,进行以下更改:-
将
packagedir = AppStream/Packages
改为packagedir = Packages
-
将
repository = AppStream
更改为repository = .
-
更改
变体 = AppStream,BaseOS
tovariants = AppStream
-
将
-
在
[tree]
部分中,将variants = AppStream,BaseOS
改为variants = AppStream
在
[variant-AppStream]
部分中进行以下更改:-
将软件包
= AppStream/Packages
改为packages = Packages
-
将
repository = AppStream
更改为repository = .
-
将软件包
-
删除文件中的以下部分:
[checksums]
,[images-x86_64]
,[images-xen]
,[media]
,[stage2]
,[variant-BaseOS]
。 - 保存并关闭该文件。
验证
/var/www/html/pub/sat-import/content/dist/rhel8/8.1/x86_64/appstream/kickstart/treeinfo
文件是否具有以下格式:[general] ; WARNING.0 = This section provides compatibility with pre-productmd treeinfos. ; WARNING.1 = Read productmd documentation for details about new format. arch = x86_64 family = Red Hat Enterprise Linux name = Red Hat Enterprise Linux 8.1.0 packagedir = Packages platforms = x86_64,xen repository = . timestamp = 1571146127 variant = AppStream variants = AppStream version = 8.1.0 [header] type = productmd.treeinfo version = 1.2 [release] name = Red Hat Enterprise Linux short = RHEL version = 8.1.0 [tree] arch = x86_64 build_timestamp = 1571146127 platforms = x86_64,xen variants = AppStream [variant-AppStream] id = AppStream name = AppStream packages = Packages repository = . type = variant uid = AppStream
如果您不打算使用挂载的二进制 DVD ISO 镜像,卸载并删除该目录:
# umount /mnt/iso # rmdir /mnt/iso
- 在 Satellite Web UI 中,启用 Kickstart 存储库。