How to list all installed packages licences in Ubuntu? -
this question has answer here:
- license info of deb package 1 answer
i want installed packages licences on server, can dump using (source 2013 post):
packages=`dpkg --get-selections | awk '{ print $1 }'` package in $packages; echo "$package: "; cat /usr/share/doc/$package/copyright; echo ""; echo ""; done > ~/licenses.txt
but output huge useless file copyright data each package. need like:
package : package_name licence: licence_name
is there parser or other tool data this?
what trying poorly supported @ moment, though there effort under way provide machine-readable information in file /usr/share/doc/*/copyright
files. see example this excerpt:
format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ upstream-name: @ source: git://anonscm.debian.org/collab-maint/at.git comment: package debianized author thomas koenig <ig25@rz.uni-karlsruhe.de>, taken on , re-packaged first martin schulze <joey@debian.org> , siggy brentrup <bsb@winnegan.de>, , taken on ryan murray <rmurray@debian.org>. . in august 2009 upstream development , debian packaging taken on ansgar burchardt <ansgar@debian.org> , cyril brulebois <kibi@debian.org>. . may considered experimental upstream source, , since there doesn't seem other upstream source, upstream source. files: * copyright: 1993-1997, thomas koenig <ig25@rz.uni-karlsruhe.de> 1993, david parsons 2002, 2005, ryan murray <rmurray@debian.org> license: gpl-2+ files: getloadavg.c copyright: 1985-1995, free software foundation inc license: gpl-2+ files: posixtm.* copyright: 1989-2007, free software foundation inc license: gpl-3+ files: parsetime.pl copyright: 2009, ansgar burchardt <ansgar@debian.org> license: isc license: gpl-2+ program free software; can redistribute and/or modify under terms of gnu general public license published free software foundation; either version 2 of license, or (at option) later version.
see specification (linked above) in http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ details.
as can see, basic assumption there single license per package false. there may multiple licenses per file -- depending on problem trying solve, may of course possible ignore many of them (for example, if want investigate whether or not have stuff under apache license, should easy do, packages have transitioned new format).
this new debian jessie, released in 2015; older versions of debian not have this. best can if need audit system older packages grep copyright
files fragments gpl, bsd, mit etc , hope you're not missing much; hope on top of flimsy grepping seem anathema proper legal work, think can assume reason attempting this. better approach might find current copyright
files packages auditing, machine-readable information, , hoping (there's word again) adequate older version have installed, too.
(for comparison, older versions, too, available @ http://metadata.ftp-master.debian.org/changelogs/main/a/at/ examine.)
i don't follow ubuntu closely longer, assume picking change since few versions back. indeed, http://packages.ubuntu.com/xenial/at seems have same copyright
file.
Comments
Post a Comment