Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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?

like image 912
Peter Avatar asked Mar 15 '10 06:03

Peter


2 Answers

rpm -qa --qf "%{name}: %{license}\n"
like image 102
Ignacio Vazquez-Abrams Avatar answered Oct 01 '22 02:10

Ignacio Vazquez-Abrams


Okay, I'm just bad at driving rpm.

rpm -qai

Output is a little untidy, but not too bad.

[Edit] Tidier output

rpm -qa --queryformat "%{NAME}-%{VERSION}: %{LICENSE}\n"
like image 34
Peter Avatar answered Oct 01 '22 01:10

Peter