简体   繁体   English

如何从安装的RPM中获取许可证列表?

[英]How can I get a list of licenses from intalled RPMs?

We've been asked to list all the software and licenses used in our organization. 我们被要求列出我们组织中使用的所有软件和许可证。 Without deciding the value of this request, I'd like to get my Fedora laptop to answer the question easily. 在没有决定这个请求的价值的情况下,我想让我的Fedora笔记本电脑轻松回答这个问题。

rpm -qa

Gives me a list of packages, but no license data. 给我一个包列表,但没有许可证数据。 My next step is to take that output and write a script to query each package's license. 我的下一步是获取该输出并编写一个脚本来查询每个包的许可证。

Anyone got an easier idea? 有人有更简单的想法吗?

rpm -qa --qf "%{name}: %{license}\n"

Okay, I'm just bad at driving rpm. 好吧,我只是擅长驾驶rpm。

rpm -qai

Output is a little untidy, but not too bad. 输出有点凌乱,但也不算太差。

[Edit] Tidier output [编辑] Tidier输出

rpm -qa --queryformat "%{NAME}-%{VERSION}: %{LICENSE}\n"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM