やっぱり Sun がスキ! : Weblog やっぱり Sun がスキ!

やっぱり Sun がスキ!

http://blogs.sun.com/yappri/date/20060725 2006年 7月 25日 火曜日

Solaris のパッケージの内容をインストールせずに確認する方法

Solaris に含まれているソフトウェアのバージョンをインストール前に確認した い時ってありませんか? たまにお客様から質問を受け、記述のあるドキュメントを 探すよりも自分でファイルの内容を確認した方が早い場合もあります。

そういうときに使用できるコマンドです。 ちなみに pkginfo でバージョンが出てくるソフトもあるので、まずは pkginfo でバージョンの確認をしてみましょう。

例 ftp のバージョンを確認する

% pkginfo -l -d /cdrom/Solaris_10/Product SUNWftpu
   PKGINST:  SUNWftpu
      NAME:  FTP Server, (Usr)
  CATEGORY:  system
      ARCH:  i386
   VERSION:  11.10.0,REV=2005.01.21.16.34
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  FTP Server and Utilities
    PSTAMP:  on10-patch-x20050608105638
   HOTLINE:  Please contact your local service provider
    STATUS:  spooled
     FILES:       14 のスプールされたパス名
                   1 のリンクされたファイル
                   2 のディレクトリ
                   7 の実行可能ファイル
                   4 のパッケージ情報ファイル
                 502 ブロック (概算値) が使われました

pkginfoで詳細のバージョンが出てこなかった場合で、 archive/ ディレクトリが有る場合は以下のような方法で バージョン確認が可能です。

1.まずはテンポラリーのディレクトリに移動

% cd /var/tmp
% pwd
/var/tmp

2. そこにパッケージの実体のファイルをコピー

% cp /cdrom/Solaris_10/Product/SUNWftpu/archive/none.bz2 ./

3. ファイルを展開する

% bunzip2 none.bz2

4. cpio でアーカイブからのファイルの復元を行う

% cpio -idmcI none
5709 ブロック

5. バージョンを確認する

% cd usr/sbin/
% ./in.ftpd -V
  Copyright (c) 1999,2000 WU-FTPD Development Group.
  All rights reserved.

  Copyright 2001-2003 Sun Microsystems, Inc.  All rights reserved.
  Use is subject to license terms.

  Portions Copyright (c) 1980, 1985, 1988, 1989, 1990, 1991, 1993, 1994
    The Regents of the University of California.
  Portions Copyright (c) 1993, 1994 Washington University in Saint Louis.
  Portions Copyright (c) 1996, 1998 Berkeley Software Design, Inc.
  Portions Copyright (c) 1989 Massachusetts Institute of Technology.
  Portions Copyright (c) 1998 Sendmail, Inc.
  Portions Copyright (c) 1983, 1995, 1996, 1997 Eric P.  Allman.
  Portions Copyright (c) 1997 by Stan Barber.
  Portions Copyright (c) 1997 by Kent Landfield.
  Portions Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997
    Free Software Foundation, Inc.

  Use and distribution of this software and its source code are governed
  by the terms and conditions of the WU-FTPD Software License ("LICENSE").
  
  If you did not receive a copy of the license, it may be obtained online
  at http://www.wu-ftpd.org/license.html.
  
Version wu-2.6.2+Sun
%

ソフトウェアのバージョン確認方法は Web でいろいろ記述があるので、 簡単に調査可能です。

これでバージョンの確認が可能です。お客様に質問されて、なるべく早い回答を 行いたいときはこれが一番かもしれません。