微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在Ubuntu中列出所有已安装的软件包许可证?

我想在我的服务器上获得所有安装的软件包许可证,我可以通过使用( 源自2013年后 )转储它:

packages=`dpkg --get-selections | awk '{ print $1 }'` for package in $packages; do echo "$package: "; cat /usr/share/doc/$package/copyright; echo ""; echo ""; done > ~/licenses.txt

但是输出一个巨大的无用文件,包含了每个包的所有版权数据。 我需要像这样的东西:

package : package_name licence: licence_name

有parsing器或其他工具来获取这样的数据吗?

ImageMagick比较:忽略来自PSNR结果的白色匹配

如何通过shell命令删除MysqL数据库

启动G-WAN的问题

./fastboot:没有这样的文件或目录

Mongo服务启动或重新启动总是失败

在Ubuntu 16.04 Xenial和apache上安装PHP 5.3或5.4

Eclipse quicktip不会在Linux Ubuntu和Centos上显示“导入”build议

在循环中运行命令时更改输出文件

Nginx的logrotate不能在亚马逊服务器上工作

在digitalocean上安装PHP 7

尽管目前正在努力在文件/usr/share/doc/*/copyright文件中提供机器可读的信息,但是您所尝试的内容却得不到支持。 例如看这个摘录 :

Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: at Source: git://anonscm.debian.org/collab-maint/at.git Comment: This package was debianized by its author Thomas Koenig <[email protected]>,taken over and re-packaged first by Martin Schulze <[email protected]> and then by Siggy Brentrup <[email protected]>,and then taken over by Ryan Murray <[email protected]>. . In August 2009 the upstream development and Debian packaging were taken over by Ansgar Burchardt <[email protected]> and Cyril Brulebois <[email protected]>. . This may be considered the experimental upstream source,and since there doesn't seem to be any other upstream source,the only upstream source. Files: * copyright: 1993-1997,Thomas Koenig <[email protected]> 1993,David Parsons 2002,2005,Ryan Murray <[email protected]> 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 <[email protected]> License: ISC License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License,or (at your option) any later version.

有关详细信息,请参阅http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/中的规范(上面链接)&#x3002;

正如你所看到的,每个软件包必须有一个许可证的基本假设是错误的。 每个文件可能有多个许可证 – 根据您要解决的问题,当然可能会忽略其中的许多许可证(例如,如果您想调查是否有Apache许可证下的东西,对于已经转换到这种新格式的软件包,这应该很容易做到)。

这是2015年发布的Debian Jessie的新功能; 旧版本的Debian没有这样的东西。 如果您需要使用较旧的软件包来审核系统,那么您可以做的最好的做法可能是对GPL,BSD,MIT等片段的copyright文件进行grep处理,然后希望您不会错过太多; 但希望在一些不光彩的问题之上似乎对任何适当的法律工作都是诅咒的,我想我们可以设想的是你们试图这样做的原因。 一个更好的方法可能是找到你正在审计的软件包的当前copyright文件,用粗略的机器可读的信息,并且希望(再次有这个词)它们适用于你已经安装的旧版本。

(为了便于比较,旧版本也可以在http://Metadata.ftp-master.debian.org/changelogs/main/a/at/找到,供您查看。&#xFF09;

我不再非常密切地关注Ubuntu,而是假定自从几个版本发布之后,他们正在接受这个改变。 确实, http://packages.ubuntu.com/xenial/at似乎有相同&#x7684;copyright文件

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐