apt show 按多个字段过滤
我想从特定的 Debian 源/存储库获取属于特定源包的所有二进制包。
apt show bla-dev 命令返回如下输出:
Package: bla-dev
Version: 1.3-2
Priority: extra
Section: libdevel
Source: bla
Maintainer: someone@someone
Installed-Size: 144 kB
Download-Size: 121 kB
APT-Sources: http://my-repo/ all/main amd64 Packages
Description: Headers
我尝试获取包含以下字段的包的所有 Package:
和 Version:
字段:
Source: bla
APT-sources: http://my-repo/
命令apt show '*-*'
显示所有包的数据,所以我认为这会很有帮助,但我真的不知道如何继续(这个命令有点重 - 长文本作为输出)
I want to get all binary packages that belong to specific source package from specific Debian source/repository.
apt show bla-dev
command returns output like this:
Package: bla-dev
Version: 1.3-2
Priority: extra
Section: libdevel
Source: bla
Maintainer: someone@someone
Installed-Size: 144 kB
Download-Size: 121 kB
APT-Sources: http://my-repo/ all/main amd64 Packages
Description: Headers
I try to get all Package:
and Version:
fields of packages that contains the fields:
Source: bla
APT-sources: http://my-repo/
The command apt show '*-*'
shows data of all packages so I think it would be helpful but I don't really know how to continue (This command is a little bit heavy - long text as output)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在
/var/lib/apt/lists/
中查找存储库的纯文本包列表元数据,它们是世界可读的:编辑:为了匹配和打印更多字段,awk 可能会工作得更好:
哪个输出:
You can grep through the plaintext package list metadata for your repo in
/var/lib/apt/lists/
, they are world-readable:Edit: to match and print more fields, awk might work better:
Which outputs: