我想编写一个脚本,输出安装在我系统上的每个软件包的许可证。
使用dpkg --get-selections我可以获得所有安装的列表。但是,我没有看到获取每个包的许可证信息的方法。例如,我可以使用aptitude show来获取每个包的属性,但这不包括许可证:
$ aptitude show apache2
Package: apache2
State: installed
Automatically installed: no
Version: 2.2.14-5ubuntu8.6
Priority: optional
Section: httpd
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Uncompressed Size: 36.9k
Depends: apache2-mpm-worker (= 2.2.14-5ubuntu8.6) | apache2-mpm-prefork (= 2.2.14-5ubuntu8.6) | apache2-mpm-event (= 2.2.14-5ubuntu8.6) | apache2-mpm-itk (= 2.2.14-5ubuntu8.6),
apache2.2-common (= 2.2.14-5ubuntu8.6)
Provided by: apache2-mpm-event, apache2-mpm-itk, apache2-mpm-prefork, apache2-mpm-worker
Description: Apache HTTP Server metapackage
The Apache Software Foundation's goal is to build a secure, efficient and extensible HTTP server as standards-compliant open …Run Code Online (Sandbox Code Playgroud)