大网数据广告活动
服务器运维问答

searching for installed rpms by vendor

· 52CE 我爱测

I am trying to figure out the syntax to use to search installed rpms by a specific Vendor in Linux. I was ideally just trying to use the rpm -qi grepping for a specific vendor but that doesn't seem to work. Anyone have the syntax…

问题原文

原帖链接 · lorrie82 · CC BY-SA 4.0

I am trying to figure out the syntax to use to search installed rpms by a specific Vendor in Linux. I was ideally just trying to use the rpm -qi grepping for a specific vendor but that doesn't seem to work. Anyone have the syntax for this search?

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

You can show packages by vendor using a query format. I'd consider something like this, to list all packages:

rpm -qa --queryformat '%{vendor}:%{name}\n' | sort > packages.txt

You can then inspect the packages.txt file, which will look something like this, and will be sorted by vendor:

Codership Oy:galera
Fedora Project:certbot
Fedora Project:clang
Fedora Project:epel-release
...
(none):gpg-pubkey
(none):nginx
...
Red Hat, Inc.:acl
Red Hat, Inc.:aic94xx-firmware
...
Remi Collet:php-cli
Remi Collet:php-common

Or you can just grep instead if you know what you're looking for.

rpm -qa --queryformat '%{vendor}:%{name}\n' | grep 'Red Hat'

But querying the rpmdb takes some time, so it's faster to dump the whole thing to a file and then read or grep the file.

grep 'Red Hat' packages.txt

For extra bonus points, try the query format '%{vendor}:%{name}:%{license}\n' which will append the license information from each RPM.

Red Hat, Inc.:acl:GPLv2+
Red Hat, Inc.:aic94xx-firmware:Redistributable, no modification permitted

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-02-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。