导读:本文介绍如何使用 rpm-ostree 查找要添加到基于 ostree 的系统(例如 Silverblue 和 Kinoite)的应用。
本文字数: 2117,阅读时长大约: 2分钟
本文介绍如何使用 rpm-ostree 查找要添加到基于 ostree 的系统(例如 Silverblue 和 Kinoite)的应用。
基于 Fedora ostree 的系统的主要优点之一是系统的不可变性。该镜像不仅是只读的,而且是预先构建在 Fedora 服务器上的。因此,更新正在运行的系统会下载更新增量(即仅差异)并修补系统。这使得许多安装在默认情况下都是相同的。
对于大多数人来说,预构建的镜像就足够了,因为通常鼓励用户同时使用 Flatpak 安装应用,使用工具箱进行开发任务。但是,如果特定应用不符合此要求并且用户需要在主机系统上安装应用怎么办?
在这种情况下,可以选择在系统上覆盖软件包,在本地创建一个新的镜像,在标准镜像上添加软件包。
但是,我如何知道我要安装哪个包?搜索功能怎么样?
老方法(toolbox + dnf search)
虽然始终可以通过支持 PackageKit 的软件中心(例如 GNOME “软件(Software)” 应用 或 KDE “发现(Discover)” 应用)搜索软件包,但通过 CLI 来搜索软件包有点困难。
由于rpm-ostree
不曾提供搜索命令,因此常见的搜索方式是使用toolbox enter
进入工具箱并使用dnf search <搜索词>
进行搜索。这样做的缺点是需要在工具箱中启用相同的仓库才能获得正确的搜索结果。
搜索neofetch
的示例:
$ toolbox enter
⬢[fedora@toolbox ~]$ dnf search neofetch
=== Name Exactly Matched: neofetch ===
neofetch.noarch : CLI system information tool written in Bash
=== Summary Matched: neofetch ===
fastfetch.x86_64 : Like neofetch, but much faster because written in c
新方法(rpm-ostree search)
从 github.com 开始,rpm-ostree
支持search
命令,允许用户使用rpm-ostree
搜索可用的软件包。一个示例命令是:
rpm-ostree search *kernel
要使用搜索命令,请首先确保你使用的是rpm-ostree
2023.6 或更高版本:
$ rpm-ostree --version
rpm-ostree:
Version: '2023.8'
Git: 9a99d0af32640b234318815a256a2d11e35fa64c
Features:
- rust
- compose
- container
- fedora-integration
如果满足版本要求,你应该能够运行rpm-ostree search <搜索词>
。
这是一个使用rpm-ostree search
搜索neofetch
的示例:
$ rpm-ostree search neofetch
===== Name Matched =====
neofetch : CLI system information tool written in Bash
===== Summary Matched =====
fastfetch : Like neofetch, but much faster because written in c
(题图:DA/5d27838e-6068-46a6-9bca-4ec486d65c46)
via:
作者: 选题: 译者: 校对:
本文由 原创编译, 荣誉推出
LCTT 译者 :geekpi
翻译: 2073.5 篇
贡献: 3717 天
2013-10-25
2023-12-29
https://linux.cn/lctt/geekpi
欢迎遵照 CC-BY-SA 协议规定转载,
如需转载,请在文章下留言 “ 转载:公众号名称”,
我们将为您添加白名单,授权“ 转载文章时可以修改”。
特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。
Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.