[步骤] SLE 软件库的启用和禁用

注意:

在启用或禁用 SLE 的软件库前,要先注册此 SLE

正文:

步骤一:显示所有可用软件库

# SUSEConnect --list-extensions

步骤二:启用软件库

# SUSEConnect -p sle-module-live-patching/15.3/x86_64

(补充:这里以启用 sle-module-live-patching/15.3/x86_64 软件库为例)

步骤三:禁用软件库

# SUSEConnect -d -p sle-module-basesystem/15.3/x86_64

(补充:这里以禁用用 sle-module-live-patching/15.3/x86_64 软件库为例)

[内容] SUSE Repository Mirroring Tool (RMT) 服务端的设置 (软件源)

内容一:显示软件源

1.1 显示所有的 SUSE 软件源产品

# rmt-cli products list --all

1.2 显示所有已经启用的 SUSE 软件源产品

# rmt-cli products list

1.3 显示所有指定版本且指定架构的 SUSE 软件源产品

# rmt-cli products list --all --version=15.4 --arch=x86_64

(补充:这里以显示所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例)

1.4 显示所有已启用指定版本且指定架构的 SUSE 软件源产品

# rmt-cli products list --version=15.4 --arch=x86_64

(补充:这里以显示所有已其应用 15.4 版本且 x86_64 架构的 SUSE 软件源产品为例)

内容二:启用软件源

2.1 启用某个软件源

# rmt-cli products enable <id>

或者:

# rmt-cli products enable <string>

2.2 开启所有指定版本且指定架构的 SUSE 软件源产品

# for i in `rmt-cli products list --all --version=15.4 --arch=x86_64 | awk '{print $2}' | egrep -v '\||ID|^$'`;do rmt-cli products enable $i;done

(补充:这里以开启所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品)

内容三:取消启用软件源

3.1 取消启用某个软件源

# rmt-cli products disable <id>

或者:

# rmt-cli products disable <string>

3.2 取消所有指定版本且指定架构的 SUSE 软件源产品

# for i in `rmt-cli products list --all --version=15.4 --arch=x86_64 | awk '{print $2}' | egrep -v '\||ID|^$'`;do rmt-cli products disable $i;done

(补充:这里以取消开启所有 15.4 版本且 x86_64 架构的 SUSE 软件源产品)

参考文献:

https://documentation.suse.com/sles/15-SP4/single-html/SLES-rmt/index.html#sec-rmt-tools-rmt-cli

[排错] 解决 openSUSE & SLE 升级系统时报错 “Can’t get available migrations from server: SUSE::Connect::ApiError: Multiple base products found:……”

报错代码

Can't get available migrations from server: SUSE::Connect::ApiError: Multiple base products found: ......

分析

当上一次升级失败或者升级回滚了以后可能会报此类错误

解决方法

方法一:通过 SUSEConnect 命令回滚

1.1 通过 SUSEConnect 命令回滚

# SUSEConnect –rollback

1.2 重新升级

(步骤略)

步骤二:取消注册再重新注册

2.1 取消注册再重新注册

(步骤略)

2.2 重新升级

(步骤略)

参考文献:

https://www.suse.com/support/kb/doc/?id=000019523

[步骤] SUSE Repository Mirroring Tool (RMT) 客户端的注册和取消注册

正文:

步骤一:注册客户端到 SUSE Repository Mirroring Tool (RMT)

1.1 通过使用 SUSEConnect 命令注册

如果是 HTTP 协议:

# SUSEConnect --url http://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>

或者:

# SUSEConnect --url http://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>:80

如果是 HTTPS 协议:

# SUSEConnect --url https://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>

或者:

# SUSEConnect --url http://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>:443

1.2 通过 RMT server 的脚本注册

1.2.1 从 RMT 服务器下载 rmt-client-setup 脚本

如果是 HTTP 协议:

# curl http://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>/tools/rmt-client-setup --output rmt-client-setup

如果是 HTTPS 协议:

# curl https://<SUSE Repository Mirroring Tool (RMT) Server's IP address or FQDN>/tools/rmt-client-setup --output rmt-client-setup
1.2.2 执行 rmt-client-setup 脚本

如果是 HTTP 协议:

# sh rmt-client-setup http://RMT_SERVER/

如果是 HTTPS 协议:

# sh rmt-client-setup https://RMT_SERVER/

步骤二:查看客户端到 SUSE Repository Mirroring Tool (RMT) 的注册状态

# SUSEConnect --status-text

步骤三:取消注册客户端到 SUSE Repository Mirroring Tool (RMT)

3.1 取消注册客户端到 SUSE Repository Mirroring Tool (RMT)

# SUSEConnect –de-register

或者:

# SUSEConnect -d

3.2 清空客户端与 SUSE Repository Mirroring Tool (RMT) 相关的缓存

# SUSEConnect --cleanup

3.3 删除客户端与 SUSE Repository Mirroring Tool (RMT) 相关的文件

# rm -f /etc/SUSEConnect
# rm -rf /etc/zypp/credentials.d/*
# rm -rf /etc/zypp/repos.d/*
# rm -f /etc/zypp/services.d/*

参考文献:

https://documentation.suse.com/sles/15-SP1/single-html/SLES-rmt/index.html#sec-rmt-client-clientsetupscript