Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

licensing - license info of a deb package

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 Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...