I am trying to get license information of uninstalled deb packages.
dpkg --info <package-name>.deb
does not give that information.
Is there any command in ubuntu which will give this info?
(In rpm world rpm -qpi gives that info)
-
See also near-duplicate http://stackoverflow.com/questions/35044841/how-to-list-all-installed-packages-licences-in-ubuntu/ – tripleee Feb 17 '16 at 13:57
1 Answers
There's no simple command that I know of. You can do something like this:
dpkg-deb --fsys-tarfile foo.deb |tar -xvO ./usr/share/doc/foo/copyright
This prints the file to standard output.
Edit Hmm, that sounds hard. After a quick perusal of the apt cache on my Debian system, I found some phrases that might be useful:
- "GNU General Public License"
- "the above copyright notice and this permission notice", making sure you unwrap lines first
"
/usr/share/common-licenses/*
"This seems to be the closest to a standard license you'll get, but be careful since often the packaging is under a common-license, but the package contents are under a separate license.
^License: MPL-1.1 | GPL-2+ | Apache-2.0
However, some packages (ImageMagick) simply have a free-form license in the copyright file that doesn't really conform to any stock license, except that someone considered it DFSG-approved.
Update 2012: This is beginning to change, as the debian/copyright
file is now required to be machine-interpretable, so you can look forward to this in the future.

- 171,072
- 38
- 269
- 275
-
1the copyright file does not have a standard format (i.e license name, license text) which makes it hard to extract that info. Specially if I want to do this for hundreds of packages. – aj. Dec 10 '09 at 23:38
-
3
-
3Update 2015: Many packages [still have not transitioned to machine-readable license files](http://stackoverflow.com/a/35052572/260122). The only online service to check for license metadata is the "Copyright File" link on the package page on https://packages.debian.org/ . – clacke Jun 13 '16 at 14:52