Cygwin パッケージ管理
- Windows7 64bit
Cygwin自体は以下のディレクトリにインストール
C:\Users\ユーザ名\cygwin
Cドライブ直下だとインストールに失敗したため。(おそらくパーミッションであろう)
○cyg-apt
http://code.google.com/p/apt-cyg/
便利っす。
■導入
1.環境準備
動作に必要な環境を揃える必要があるが、これらはGUIのsetup.exeからインストールする。
2.インストール
Cygwinに接続して、ダウンロードする。
$ wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg $ mv apt-cyg /usr/bin/ $ chmod +x /usr/bin/apt-cyg
■操作
ヘルプより
$ apt-cyg apt-cyg: Installs and removes Cygwin packages. "apt-cyg install <package names>" to install packages "apt-cyg remove <package names>" to remove packages "apt-cyg update" to update setup.ini "apt-cyg show" to show installed packages "apt-cyg find <patterns>" to find packages matching patterns "apt-cyg describe <patterns>" to describe packages matching patterns "apt-cyg packageof <commands or files>" to locate parent packages Options: --mirror, -m <url> : set mirror --cache, -c <dir> : set cache --file, -f <file> : read package names from file --noupdate, -u : don't update setup.ini from mirror --help --version
○環境設定
apt-cygを実行すると、毎回「setup.ini」を書き換える動作をする。
何気に邪魔なので「-u」オプションを指定する。
インストール出来ない場合などに、改めてアップデートする方向で。
そのため、Aliasを作成する
$ vi .bashrc alias apt-cyg='apt-cyg -u' $ . .bashrc
○検索
・パッケージ名は部分一致で検索している模様(大文字小文字の区別はしてくれない。明示的に指定する)
$ apt-cyg find vim Working directory is /setup Mirror is ftp://mirror.mcs.anl.gov/pub/cygwin Searching for installed packages matching vim: vim vim-common Searching for installable packages matching vim: gvim vim vim-common
○インストール
$ apt-cyg install make Working directory is /setup Mirror is ftp://mirror.mcs.anl.gov/pub/cygwin Installing make Found package make --2012-08-23 19:33:26-- ftp://mirror.mcs.anl.gov/pub/cygwin/release/make/make-3.82.90-1.tar.bz2 => `make-3.82.90-1.tar.bz2' ...省略 Package _update-info-dir is already installed, skipping Package make installed
■背景
Cygwin標準のパッケージ管理ツールが「setup.exe」となり、
検索が遅かったりいちいちGUI起動とかとかなり不便なので検索してみた。
といっても最初にCygwin入れてる時点で使用目的が明確なので、
そもそもパッケージ管理自体、使う機会がないかも…。