#navi(../)
* apt-cacheコマンドでパッケージ情報を確認する方法・showオプション [#j7849c5c]
apt-cacheコマンドでshowオプションとパッケージ名を渡すとパッケージ情報を取得し表示することができます。~
以下に使用例を記します。
使用したLinuxディストリビューションは以下の通りです。
 $ lsb_release -a
 No LSB modules are available.
 Distributor ID:	Raspbian
 Description:	Raspbian GNU/Linux 8.0 (jessie)
 Release:	8.0
 Codename:	jessie
Debian系(Ubuntu系)であれば、動作します。

#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)

* 関連記事 [#j2ce709d]
-[[yumコマンドでパッケージ情報を確認する方法>Linux環境設定/yumコマンドでパッケージ情報を確認する方法]]

* apt-cacheでパッケージ情報を取得する [#l9aa429d]
以下の構文でパッケージの情報を取得することができます。
 apt-cache show パッケージ名
以下にPostgreSQLとPHPをパッケージ名として使用してapt-cache showを実行した時の出力例を記します。

** apt-cache show postgresql [#j4d23115]
 pi@raspberrypi:~ $ apt-cache show postgresql
 Package: postgresql
 Source: postgresql-common (165+deb8u1)
 Version: 9.4+165+deb8u1
 Installed-Size: 74
 Maintainer: Debian PostgreSQL Maintainers <pkg-postgresql-public@lists.alioth.debian.org>
 Architecture: all
 Depends: postgresql-9.4
 Suggests: postgresql-doc
 Size: 52106
 SHA256: 44e231c4d73bd0bbd567a9a32457d1210f5d3a8bd671998b96756c2819ca84ba
 SHA1: f1aa1a9e5253998c54cf77c642208daeff8189d1
 MD5sum: 7a5c3abc2286bc5f8a51d9a542351f3e
 Description: object-relational SQL database (supported version)
  This metapackage always depends on the currently supported PostgreSQL
  database server version.
  .
  PostgreSQL is a fully featured object-relational database management
  system.  It supports a large part of the SQL standard and is designed
  to be extensible by users in many aspects.  Some of the features are:
  ACID transactions, foreign keys, views, sequences, subqueries,
  triggers, user-defined types and functions, outer joins, multiversion
  concurrency control.  Graphical user interfaces and bindings for many
  programming languages are available as well.
 Description-md5: bdff2d6e5b2a1dd00e72b3ed8729d9ac
 Tag: devel::lang:sql, interface::daemon, network::server, network::service,
  role::metapackage, role::program, suite::postgresql, works-with::db
 Section: database
 Priority: optional
 Filename: pool/main/p/postgresql-common/postgresql_9.4+165+deb8u1_all.deb



** apt-cache show php5 [#t1657bdd]
 pi@raspberrypi:~ $ apt-cache show php5
 Package: php5
 Version: 5.6.26+dfsg-0+deb8u1
 Installed-Size: 1
 Maintainer: Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>
 Architecture: all
 Depends: libapache2-mod-php5 (>= 5.6.26+dfsg-0+deb8u1~) | libapache2-mod-php5filter (>= 5.6.26+dfsg-0+deb8u1~) | php5-cgi (>= 5.6.26+dfsg-0+deb8u1~) |
 php5-fpm (>= 5.6.26+dfsg-0+deb8u1~), php5-common (>= 5.6.26+dfsg-0+deb8u1~)
 Size: 1312
 SHA256: 62320ad6856c133822850387635ee1e5503c22ba8390c0c10c4e76a8fbe1b446
 SHA1: 8f4c3ecc34a490749b2967d5f88b7e8fc0a9da80
 MD5sum: 88c61d6747ca1ca21311fea38c21c2e0
 Description: server-side, HTML-embedded scripting language (metapackage)
  This package is a metapackage that, when installed, guarantees that you
  have at least one of the four server-side versions of the PHP5 interpreter
  installed. Removing this package won't remove PHP5 from your system, however
  it may remove other packages that depend on this one.
  .
  PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used
  open source general-purpose scripting language that is especially suited
  for web development and can be embedded into HTML.
 Description-md5: 2af39c852a986c9d371da68ad88cdc6e
 Homepage: http://www.php.net/
 Section: php
 Priority: optional
 Filename: pool/main/p/php5/php5_5.6.26+dfsg-0+deb8u1_all.deb


以上、apt-cache show package によるパッケージ情報の取得方法でした。

#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS