Windows に Unix(Linux) like な環境を提供する Cygwin 特有のコマンドである Cygcheck についての備忘録.
Cygwin には setup.exe (32-bit installation) もしくは setup-x86_64.exe (64-bit installation) の GUI で使えるパッケージシステムがあるので,その他のパッケージ関係のコマンドがあるとは思っていなかったのですが,どうも
- インストールとアンインストールは setup.exe (setup-x86_64.exe)
- その他は cygcheck
という使い分けのようですね.以下が使用例.
# 依存状況を表示(-v で verbose表示)
$ cygcheck bash
Found: C:\Opt\cygwin64\bin\bash.exe
Found: C:\Opt\git\bin\bash.exe
C:\Opt\cygwin64\bin\bash.exe
C:\Opt\cygwin64\bin\cygwin1.dll
C:\WINDOWS\system32\KERNEL32.dll
C:\WINDOWS\system32\ntdll.dll
C:\WINDOWS\system32\KERNELBASE.dll
C:\Opt\cygwin64\bin\cygiconv-2.dll
C:\Opt\cygwin64\bin\cygintl-8.dll
C:\Opt\cygwin64\bin\cygncursesw-10.dll
C:\Opt\cygwin64\bin\cygreadline7.dll
C:\WINDOWS\system32\USER32.dll
C:\WINDOWS\system32\GDI32.dll
# インストールパッケージ全ての表示
$ cygcheck -c
Cygwin Package Information
Package Version Status
_autorebase 001004-1 OK
_update-info-dir 03000-1 OK
alternatives 1.3.30c-10 OK
base-cygwin 3.8-1 OK
base-files 4.2-4 OK
bash 4.3.42-4 OK
binutils 2.25-4 OK
bzip2 1.0.6-2 OK
...
# 特定のパッケージがインストールされているかどうか
$ cygcheck -c bash
Cygwin Package Information
Package Version Status
bash 4.3.42-4 OK
# システム情報の表示(-r でレジストリもチェック)
$ cygcheck -s -r
Cygwin Configuration Diagnostics
Current System Time: Fri Jul 01 13:50:17 2016
Windows 10 Home Ver 10.0 Build 10586
Path: C:\Opt\cygwin64\usr\local\bin
C:\Opt\cygwin64\usr\local\sbin
C:\Opt\cygwin64\bin
C:\WINDOWS\system32
...
# ファイルが所属するパッケージの表示
$ cygcheck -f /usr/bin/gsbj
ghostscript-9.19-1
# cygwin.com package repository から正規表現で検索
$ cygcheck -p "a2ps-*"
Found 11 matches for a2ps-*
a2ps-debuginfo-4.14-2 - a2ps-debuginfo: Debug info for a2ps (installed binaries and support files)
...
# レジストリから未使用の key を削除
$ cygcheck --delete-orphaned-installation-keys
cygcheck -p は便利かな.

