红帽企业 Linux(RHEL)Lightspeed 将数十年的 RHEL 专业知识与 AI 技术相结合,助您成为 Linux 系统方面的专家。RHEL Lightspeed 可主动提供引导并简化 IT 专业人员(无论是新手还是经验丰富的人员)构建、部署和管理 RHEL 的方式。
RHEL Lightspeed 由两项功能组成,这两项功能均已包含在您的 RHEL 订阅权益中:
- 由 RHEL Lightspeed 提供支持的命令行助手提供可直接从命令行界面使用的 AI 助手。它适用于 RHEL 9.6 和 RHEL 10。
- 通过由 RHEL Lightspeed 提供支持的智能分析镜像构建器软件包建议,可分析您在智能分析镜像构建器中选择的软件包,并为可能与您的镜像构建有关的其他软件包提供建议。
由 RHEL Lightspeed 提供支持的命令行助手
命令行助手提供依托 AI 的助手,可通过 RHEL 命令行使用。它可以在回答问题时整合 RHEL 文档和红帽知识库中的信息,让用户更轻松地获取红帽数十年来积累的 Linux 专业知识。该工具使用自然语言界面,能够回答 RHEL 相关问题、协助进行故障排除,并可作为学习辅助工具使用。命令行助手能够提升 RHEL 用户的工作效率,无论新手还是资深专家,皆是如此。
命令行助手只需极少的硬件资源即可运行,因为它连接到托管服务来处理请求并提供响应。RHEL 订阅中包含此项托管服务。
要开始使用命令行助手,请安装 RHEL 9.6 和 10.0 上提供的 command-line-assistant
软件包:
$ sudo dnf install command-line-assistant
然后,您可以使用 c 命令来提出问题。在下面的示例中,我请求帮助分析系统启动缓慢的原因:
c "Help me figure out why this system is slow to boot"
+ Asking RHEL Lightspeed
To diagnose slow boot times in Red Hat Enterprise Linux (RHEL), you can use the systemd-analyze command set. Here's how you can proceed:
1. Check the overall boot time: Use the command systemd-analyze time. This will give you an overview of the total time taken for the last successful boot.
2. Identify services causing delays: To pinpoint which services are contributing to the boot time, use the command systemd-analyze blame. This command lists all services in descending order based on the time they took to initialize during the last boot. The service at the top of the list is the one taking the most time to start.
3. Examine critical boot dependencies: If your boot process is waiting for certain services to start, you can identify these dependencies with systemd-analyze critical-chain. This command shows the units at critical points where the boot process waits for dependencies to be satisfied. For example, if postfix.service depends on network.target, and network.target depends on network.service, you'll see this dependency chain.
Remember to review the output of these commands to understand which services are causing the delay and consider disabling unnecessary services that start at boot to improve boot times. Always ensure that disabling services does not adversely affect system functionality.
For more detailed guidance and additional optimization strategies, refer to the Red Hat Knowledgebase article at [https://access.redhat.com/solutions/2478981 (https://access.redhat.com/solutions/2478981).
Always review AI-generated content prior to use.
您可能想知道我们为什么选择 c
命令。原因有二:
- 命令行助手的使用频率很高,因此我们需要一个简短的命令名
- 在科学设置中,光速用 c 字符表示,这与 Lightspeed 相吻合!
但不必担心,如果您系统上的 c
命令与之冲突(例如别名),您也可以根据需要使用 cla
命令。
以下快速参考指南可帮助您开始使用命令行助手:
命令 | 说明 |
c 或 cla | 使用 |
c "type question/prompt here" | 运行 |
c -a filename “question/prompt” | 您可以使用 |
command | c “question/prompt” | 您可以将另一个命令的输出导入命令行助手。例如:
|
c -i | 启动命令行助理的交互式会话。 |
c history -a | 显示对话历史记录。有关其他与历史记录相关的选项,请参阅 man |
有关更多详细信息,请参阅 RHEL 9 和 RHEL 10 的 RHEL Lightspeed 文档,以及可通过 man c
命令访问的手册页。
我们提供了一个“借助命令行助手解决各种问题”的交互式实验室环境,介绍了几种使用场景,并允许您试用命令行助手。
由 RHEL Lightspeed 提供支持的智能分析镜像构建器软件包建议
智能分析镜像构建器可以为多个平台构建 RHEL 镜像,并提供许多功能,如配置自定义文件系统布局和 OpenSCAP 安全防护策略等功能。构建镜像时,其中一个步骤是指定是否要在镜像中包含任何其他软件包。智能分析镜像构建器软件包建议功能会分析您选择要包含在镜像中的软件包,并为可能相关的其他软件包提供建议。您可以查看这些建议,并决定是否要采纳。
在以下示例中,我在智能分析镜像构建器中选择了 adcli
软件包,并收到了两个关于其他软件包的建议,如屏幕底部所示:

有关智能分析镜像构建器的更多详细信息,请参阅在混合云中部署和管理 RHEL 系统文档。
后续步骤
如果您有兴趣在使用 RHEL 系统时利用 AI 来提高工作效率,请立即试用命令行助手,具体方法如下:安装 command-line-assistant
软件包,或尝试使用借助命令行助手解决各种问题交互式实验室环境。下次使用智能分析镜像构建器构建新的 RHEL 镜像时,请查看软件包建议,以了解可能在您的环境中有用的其他软件包。
关于作者
Brian Smith is a product manager at Red Hat focused on RHEL automation and management. He has been at Red Hat since 2018, previously working with public sector customers as a technical account manager (TAM).