自定义通道
自定义通道使您能够创建自己的软件包和储存库,然后可以使用这些软件包和储存库来更新您的客户端。它们还使您能够在环境中使用第三方供应商提供的软件。
本节提供有关如何创建、管理和删除自定义通道的更多细节。您必须拥有管理员特权才能创建和管理自定义通道。
1. 创建自定义通道和储存库
在创建自定义通道之前,请确定要将其关联到哪个基础通道,以及要为内容使用哪些储存库。
如果您需要将自定义软件包安装在客户端系统上,可以创建自定义子通道来管理它们。需要在 SUSE Multi-Linux Manager Web UI 中创建通道,并为软件包创建储存库,然后将该通道指派到系统。
|
不要创建其中有软件包与客户端系统不兼容的子通道。 |
You can select a vendor channel as the base channel if you want to use packages provided by a vendor. Alternatively, select none to make your custom channel a base channel.
在 SUSE Multi-Linux Manager Web UI 中,导航到,然后单击 创建通道。
On the
Create Software Channelpage, give your channel a name (for example,My Tools SLES 15 SP1 x86_64) and a label (for example,my-tools-sles15sp1-x86_64). 标签不能包含空格或大写字母。In the
Parent Channeldrop down, choose the relevant base channel (for example,SLE-Product-SLES15-SP1-Pool for x86_64). 确保为软件包选择兼容的父通道。In the
Architecturedrop down, choose the appropriate hardware architecture (for example,x86_64).根据环境的需要,在联系方法细节、通道访问控制和 GPG 字段中提供任何附加信息。
单击 创建通道。
Custom channels sometimes require additional security settings. Many third party vendors secure packages with GPG. If you want to use GPG-protected packages in your custom channel, you need to trust the GPG key which has been used to sign the metadata. You can then check the Has Signed Metadata? check box to match the package metadata against the trusted GPG keys.
If remote channels and repositories are signed with GPG keys, you can import and trust these GPG keys. For example, execute the spacewalk-repo-sync from the command line on the SUSE Multi-Linux Manager Server:
/usr/bin/spacewalk-repo-sync -c <通道标签名称> -t yum
此命令和过程仅可用于对 GPG 密钥进行临时同步。如需长期存储密钥,请参见后文相关章节。
The underlying zypper call will import the key, if it is available. The Web UI does not offer this feature.
但这仅在您要镜像的储存库满足以下条件时才生效:需要以特殊方式配置,且在储存库中与签名一同提供“密钥”。开放式构建服务 (OBS) 生成的所有储存库均符合此要求。对于其他储存库,则需执行特殊的准备步骤,具体说明如下。
|
By default, the |
You can only add a repository to the SUSE Multi-Linux Manager with the Web UI if it is a valid software repository. Check in advance that needed repository metadata are available. Tools such as createrepo and reprepro are useful in this regard. mgrpush can help with pushing a single RPM into a channel without creating a repository.
-
For more information on
createrepo_cseehttps://manpages.opensuse.org/Leap-15.6/createrepo_c/ -
For more information on
repreproseehttps://manpages.opensuse.org/Leap-15.6/reprepro/
在 SUSE Multi-Linux Manager Web UI 中,导航到,然后单击 创建储存库。
On the
Create Repositorypage, give your repository a label (for example,my-tools-sles15sp1-x86_64-repo).In the
Repository URLfield, provide the path to the directory that contains therepodatafile (for example,file:///opt/mytools/). You can use any valid addressing protocol in this field.Uncheck the
Has Signed Metadata?check box.可选:如果您的储存库需要客户端证书身份验证,请填写 SSL 字段。
单击 创建储存库。
仅当您要镜像的储存库中在签名旁边提供了“key”时,才能正常完成上述过程。OBS 生成的所有储存库都是这种情况,但不是由 OBS 提供的操作系统储存库并非如此。
If the repository you want to use does not have a GPG key you can provide one yourself and import the GPG key into the keyring manually. If you import the key into the /var/lib/spacewalk/gpgdir keyring using the gpg command line tool it would be stored permanently. The key would also persist if the chroot environment would be cleaned.
在容器主机上,用于将密钥导入密钥环的命令是:
mgradm gpg add /path/to/gpg.key有关详细信息,请参见 使用您自己的 GPG 密钥。
Add Debian non-flat repositories using
uyuni_suite,uyuni_component, anduyuni_archquery parameters.
uyuni_suite-
is mandatory. In Debian documentation, this is also known as
distribution. With this parameter you specify the apt source. Without this parameter the original approach is used. If the parameter ends with/, the repository is identified as flat. uyuni_component-
是可选的。此参数只能指定一个组件。无法列出组件。一个 apt 源项允许指定多个组件,但对于 Uyuni 无法做到这一点。对此,您必须为每个组件创建单独的储存库。
uyuni_arch-
is optional. If omitted the architecture name is calculated with a SQL query for the channel from the database. Specify
uyuni_archexplicitly if it does not match the architecture of the channel (sometimes architecture naming is ambiguous).
下面提供了一些示例:
| Type | Source line / URL |
|---|---|
apt source line |
|
URL mapping |
|
|
|
apt source line |
|
URL mapping |
|
|
以下有关 Debian 储存库定义格式的信息基于 https://wiki.debian.org/DebianRepository/Format#Overview。 储存库定义格式如下: deb URI 套件 [组件 1] [组件 2] [...] 例如: deb https://deb.debian.org/debian/dists stable main 或 deb https://pkg.jenkins.io/debian-stable binary/ For each pair of |
通过导航到,并单击新建的自定义通道的名称,将新储存库指派到自定义通道。
Navigate to the
Repositoriestab, and ensure the repository you want to assign to the channel is checked. Click Save Repositories.默认情况下,同步过程会立即开始。
有关通道同步的详细信息,请参见 自定义通道同步。
在 SUSE Multi-Linux Manager Web UI 中,导航到,然后选择要将自定义通道添加到的密钥。
On the
Detailstab, in theChild Channelslisting, select the channel to associate. 如果需要,您可以选择多个通道。单击 更新激活密钥。
2. 自定义通道同步
为了避免错过重要更新,SUSE 建议通过远程储存库更改来使您的自定义通道保持最新。
默认情况下,您创建的所有自定义通道将自动同步。具体而言,在以下情况下将发生同步:
-
after adding a repository to a channel from the UI or by using
spacewalk-common-channels -
as part of the daily task
mgr-sync-refresh-default, which will synchronize all your custom and vendor channels.
To disable this default behaviour, set in /etc/rhn/rhn.conf:
java.unify_custom_channel_management = 0
关闭此属性后,将不会自动执行同步,要使自定义通道保持最新,您需要:
-
synchronize it manually by navigating to the
Synctab and click Sync Now, -
set up an automated synchronization schedule from the
Repositoriestab.
该过程开始后,可通过多种方式检查通道是否已完成同步:
-
In the SUSE Multi-Linux Manager Web UI, navigate to and select the
Productstab. 产品同步时,此对话框将为每个产品显示一个完成栏。 -
在 SUSE Multi-Linux Manager Web UI 中,导航到,然后单击与储存库关联的通道。 Navigate to the menu:[Repositories > Sync] tab. The
Sync Statusis shown next to the repository name. -
在命令提示符下检查同步日志文件:
tail -f /var/log/rhn/reposync/<channel-label>.log
每个子通道在同步过程中会生成自身的日志。您需要检查所有基础通道和子通道日志文件,以确保同步完成。
可使用以下自定义通道同步选项:
- 保留已从储存库中去除的通道中的软件包
-
This turns off
strictmode. - 不同步勘误
-
不要同步补丁。
- 仅同步最新软件包
-
仅同步最新的软件包版本。
- 创建可无人值守安装树
-
此选项准备一个随时可用于自动安装 Kickstart 的目录树。
- 出现任何错误时终止
-
如果发生错误,则停止同步。
将为每个通道永久保存这些选项。在执行同步之前,单击立即同步按钮也会保存通道选项。
3. 将软件包和补丁添加到自定义通道
如果您创建新的自定义通道但未从现有通道克隆,则创建的通道不包含任何软件包或补丁。可以使用 SUSE Multi-Linux Manager Web UI 添加所需的软件包和补丁。
自定义通道只能包含克隆的或者自定义的软件包或补丁,并且这些软件包或补丁必须与通道的基础体系结构相匹配。添加到自定义通道的补丁必须适用于通道中的软件包。
In the SUSE Multi-Linux Manager Web UI, navigate to , and go to the
Packagestab.OPTIONAL: See all packages currently in the channel by navigating to the
List/Removetab.Add new packages to the channel by navigating to the
Addtab.选择要为其提供软件包的父通道,然后单击 查看软件包 以填充列表。
检查要添加到自定义通道的软件包,然后单击 添加软件包。
如果您觉得选择合适,请单击 确认添加 以将软件包添加到通道。
可选:可以通过导航到,然后转到选项卡,将当前通道中的软件包与其他通道中的软件包进行比较。 要使两个通道相同,请单击 合并差异 按钮,然后解决任何冲突。
In the SUSE Multi-Linux Manager Web UI, navigate to , and go to the
Patchestab.OPTIONAL: See all patches currently in the channel by navigating to the
List/Removetab.Add new patches to the channel by navigating to the
Addtab, and selecting what kind of patches you want to add.选择要为其提供补丁的父通道,然后单击 浏览关联补丁 以填充列表。
检查要添加到自定义通道的补丁,然后单击 确认。
如果您觉得选择合适,请单击 确认 以将补丁添加到通道。
4. 管理自定义通道
SUSE Multi-Linux Manager 管理员和通道管理员可以更改或删除任何通道。
To grant other users rights to alter or delete a channel, navigate to and select the channel you want to edit. Navigate to the Managers tab, and check the user to grant permissions. Click Update to save the changes.
|
如果您删除某个已指派到一组客户端的通道,与已删除通道关联的任何客户端的通道状态将立即更新。这是为了确保在储存库文件中准确反映所做的更改。 |
无法使用 Web UI 删除 SUSE Multi-Linux Manager 通道。只能删除自定义通道。
在 SUSE Multi-Linux Manager Web UI 中,导航到,然后选择要删除的通道。
单击 删除软件通道。
On the
Delete Channelpage, check the details of the channel you are deleting, and check theUnsubscribe Systemscheckbox to remove the custom channel from any systems that might still be subscribed.单击 删除通道。
删除通道时,不会自动去除其中的软件包。您无法更新其通道已被删除的软件包。
可以在 SUSE Multi-Linux Manager Web UI 中删除与通道没有关联的软件包。导航到,选中要去除的软件包,然后单击 删除软件包。