Comment obtenir des informations sur l'archive du paquet deb?

31

Comment obtenir des informations sur l' .debarchive des packages?

Comme: informations sur le package, version, taille installée, architecture, description et informations de licence , etc. à partir des .debarchives du package?

Pandya
la source

Réponses:

44

Vous pouvez utiliser la dpkg-debcommande pour manipuler archive des paquets Debian (.deb).

Depuis la page de manuel: -

-I, --info archive [control-file-name...]
              Provides information about a binary package archive.

              If  no  control-file-names are specified then it will print a summary of the contents of the package as
              well as its control file.

              If any control-file-names are specified then dpkg-deb will print them in the order they were specified;
              if  any  of  the components weren't present it will print an error message to stderr about each one and
              exit with status 2.

Exemple d'utilisation: -

$ dpkg-deb -I intltool_0.50.2-2_all.deb 
 new debian package, version 2.0.
 size 52040 bytes: control archive=1242 bytes.
     831 bytes,    19 lines      control              
    1189 bytes,    18 lines      md5sums              
 Package: intltool
 Version: 0.50.2-2
 Architecture: all
 Maintainer: Ubuntu Developers <[email protected]>
 Original-Maintainer: Debian GNOME Maintainers <[email protected]>
 Installed-Size: 239
 Depends: gettext (>= 0.10.36-1), patch, automake | automaken, perl (>= 5.8.1), libxml-parser-perl, file
 Provides: xml-i18n-tools
 Section: devel
 Priority: optional
 Multi-Arch: foreign
 Homepage: https://launchpad.net/intltool
 Description: Utility scripts for internationalizing XML
  Automatically extracts translatable strings from oaf, glade, bonobo
  ui, nautilus theme and other XML files into the po files.
  .
  Automatically merges translations from po files back into .oaf files
  (encoding to be 7-bit clean). The merging mechanism can also be
  extended to support other types of XML files.

Vous pouvez lister le contenu par dpkg-deb -c: -

Exemple d'utilisation:

$ dpkg-deb -c libnotify-bin_0.7.6-1ubuntu3_i386.deb 
drwxr-xr-x root/root         0 2014-02-22 05:24 ./
drwxr-xr-x root/root         0 2014-02-22 05:24 ./usr/
drwxr-xr-x root/root         0 2014-02-22 05:24 ./usr/bin/
-rwxr-xr-x root/root      9764 2014-02-22 05:24 ./usr/bin/notify-send
drwxr-xr-x root/root         0 2014-02-22 05:24 ./usr/share/
drwxr-xr-x root/root         0 2014-02-22 05:24 ./usr/share/man/
drwxr-xr-x root/root         0 2014-02-22 05:24 ./usr/share/man/man1/
-rw-r--r-- root/root       773 2014-02-22 05:24 ./usr/share/man/man1/notify-send.1.gz
drwxr-xr-x root/root         0 2014-02-22 05:24 ./usr/share/doc/
drwxr-xr-x root/root         0 2014-02-22 05:25 ./usr/share/doc/libnotify-bin/
-rw-r--r-- root/root      1327 2011-07-31 03:11 ./usr/share/doc/libnotify-bin/copyright
lrwxrwxrwx root/root         0 2014-02-22 05:25 ./usr/share/doc/libnotify-bin/AUTHORS -> ../libnotify4/AUTHORS
lrwxrwxrwx root/root         0 2014-02-22 05:25 ./usr/share/doc/libnotify-bin/NEWS.gz -> ../libnotify4/NEWS.gz
lrwxrwxrwx root/root         0 2014-02-22 05:25 ./usr/share/doc/libnotify-bin/changelog.Debian.gz -> ../libnotify4/changelog.Debian.gz

Obtenir des informations de licence: -

La plupart des informations sur les droits d' auteur des archives sont disponibles sur/usr/share/doc/<pkgname>/copyright

Exemple :-

$ dpkg-deb -c gparted_0.18.0-1_i386.deb | grep -i copyright
-rw-r--r-- root/root      1067 2011-12-08 00:34 ./usr/share/doc/gparted/copyright

Que vous pouvez extraire -xet rechercher la licence sous laquelle il est publié.

Ici:-

$ cat /usr/share/doc/gparted/copyright | grep -i ^license -A 5
License:

   This package 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; version 2 dated June, 1991.

Pour en savoir plus, exécutez man dpkg-deb.

Pandya
la source
5

Vous pouvez utiliser dpkg -f (archive) (field name)pour faire exactement cela.

Exemple:

dpkg -f archive.deb Version
dpkg -f archive.deb Package

Pour obtenir des noms de champs possibles:

dpkg --info archive.deb
rire_homme
la source
Cela n'inclut pas les informations de licence.
Lucas