I want to check what licenses all the packages on my system is running under.
It seems like this information is located in /usr/share/doc/package/copyright
However this file seems like it does not have any standard format, I've been going through this manually to record the licenses. is there another way to get this information, through something like dpkg-query?