checkinstallをインストール

checkinstallはソースアーカイブから簡単にRPM形式などのパッケージを生成してくれる便利なコマンドです。

FedoraCentOSを使用してる時にリポジトリが意図したパッケージをインストール出来ない時、ソースからコンパイルしてインストールする事が多いかと思います。ですが、検証などでインストールとアンインストールを繰り返す場合などは、パッケージ管理している方がアンインストールが楽に感じると思います。

まずはCheckInstall Homepageからtarボールをダウンロードしてきます。

$ wget http://www.asic-linux.com.mx/~izto/checkinstall/files/source/checkinstall-1.6.2.tar.gz

checkinstallのソースからインストールを実行

$ tar xfvz checkinstall-1.6.2.tar.gz
$ cd checkinstall-1.6.2
$ make
# make install
# which checkinstall
/usr/local/sbin/checkinstall


せっかくなんで、checkinstall自体をパッケージ化してしまってRPMで管理出来るようにしてしまう事に。

checkinstall自身の機能を使ってソースからPRMパッケージを生成

$ make
# checkinstall

The package documentation directory ./doc-pak does not exist. 
Should I create a default set of package docs?  [y]: y ### 'y'入力でドキュメント関係もインストール

Preparing package documentation...OK

Please choose the packaging method you want to use.
Slackware [S], RPM [R] or Debian [D]? R ### RPMパッケージ生成のために'R'入力


**************************************
**** RPM package creation selected ***
**************************************

This package will be built according to these values: 

1 -  Summary: [ CheckInstall installations tracker, version 1.6.2 ]
2 -  Name:    [ checkinstall ]
3 -  Version: [ 1.6.2 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ x86_64 ]
8 -  Source location: [ checkinstall-1.6.2 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ checkinstall ]

Enter a number to change any of them or press ENTER to continue: ### 特に編集は必要無いので'Enter'で実行

Installing with make install...

========================= Installation results ===========================
ERROR: ld.so: object '/usr/local/lib64/installwatch.so' from LD_PRELOAD cannot be preloaded: ignored.
ERROR: ld.so: object '/usr/local/lib64/installwatch.so' from LD_PRELOAD cannot be preloaded: ignored.
                            :
                            :

と、64bit環境の場合上記のエラーが出る。

なので、このような場合には下記のようにシンボリックリンクを生成して対処

# ln -s /usr/loca/ l/lib/installwatch.so /usr/local/lib64/installwatch.so
# ll /usr/local/lib64/installwatch.so
lrwxrwxrwx 1 root root 30 Jun  9 22:27 /usr/local/lib64/installwatch.so -> /usr/local/lib/installwatch.so

再度checkinstallコマンドを実行

# checkinstall

checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.

The checkinstallrc file was not found at:
/usr/local/sbin/../checkinstallrc

Assuming default values.

The package documentation directory ./doc-pak does not exist. 
Should I create a default set of package docs?  [y]: y

Preparing package documentation...OK

Please choose the packaging method you want to use.
Slackware [S], RPM [R] or Debian [D]? R


**************************************
**** RPM package creation selected ***
**************************************

This package will be built according to these values: 

1 -  Summary: [ CheckInstall installations tracker, version 1.6.2 ]
2 -  Name:    [ checkinstall ]
3 -  Version: [ 1.6.2 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ Applications/System ]
7 -  Architecture: [ x86_64 ]
8 -  Source location: [ checkinstall-1.6.2 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ checkinstall ]

Enter a number to change any of them or press ENTER to continue: 

Installing with make install...
                  :
                  :

======================== Installation successful ==========================

Copying documentation directory...
./
./INSTALL
./TODO
./Changelog
./FAQ
./README
./COPYING
./BUGS
./CREDITS
./RELNOTES

Copying files to the temporary directory...OK

Stripping ELF binaries...OK

Compressing man pages...OK

Building file list...OK

Building RPM package...OK

NOTE: The package will not be installed

Erasing temporary files...OK

Deleting doc-pak directory...OK

Writing backup package...OK
OK

Deleting temp dir...OK


**********************************************************************

 Done. The new package has been saved to

 /usr/src/redhat/RPMS/x86_64/checkinstall-1.6.2-1.x86_64.rpm ### 無事パッケージが生成
 You can install it in your system anytime using: 

      rpm -i checkinstall-1.6.2-1.x86_64.rpm

**********************************************************************

パッケージとして生成されたcheckinstallをインストール

# rpm -ivh /usr/src/redhat/RPMS/x86_64/checkinstall-1.6.2-1.x86_64.rpm
Preparing...              ########################################### [100%]
   1:checkinstall           ########################################### [100%]

インストール状態を確認

# rpm -qi checkinstall
Name        : checkinstall                 Relocations: (not relocatable)
Version     : 1.6.2                             Vendor: (none)
Release     : 1                             Build Date: Thu Jun  9 22:29:09 2011
Install Date: Thu Jun  9 22:29:42 2011         Build Host: vm-host1
Group       : Applications/System           Source RPM: checkinstall-1.6.2-1.src.rpm
Size        : 457305                           License: GPL
Signature   : (none)
Packager    : checkinstall-1.6.2
Summary     : CheckInstall installations tracker, version 1.6.2
Description :
CheckInstall installations tracker, version 1.6.2

CheckInstall  keeps  track of all the files created  or
modified  by your installation  script  ("make install"
"make install_modules",  "setup",   etc),   builds    a
standard   binary   package and  installs  it  in  your
system giving you the ability to uninstall it with your
distribution's  standard package management  utilities.

# which checkinstall
/usr/local/sbin/checkinstall
# rpm -ql checkinstall
/usr
/usr/doc
/usr/doc/checkinstall
/usr/doc/checkinstall/BUGS
/usr/doc/checkinstall/COPYING
/usr/doc/checkinstall/CREDITS
/usr/doc/checkinstall/Changelog
/usr/doc/checkinstall/FAQ
/usr/doc/checkinstall/INSTALL
/usr/doc/checkinstall/README
/usr/doc/checkinstall/RELNOTES
/usr/doc/checkinstall/TODO
/usr/local
/usr/local/bin
/usr/local/bin/installwatch
/usr/local/lib
/usr/local/lib/checkinstall
/usr/local/lib/checkinstall/checkinstallrc-dist
/usr/local/lib/checkinstall/locale
/usr/local/lib/checkinstall/locale/de
/usr/local/lib/checkinstall/locale/de/LC_MESSAGES
/usr/local/lib/checkinstall/locale/de/LC_MESSAGES/checkinstall.mo
/usr/local/lib/checkinstall/locale/es
/usr/local/lib/checkinstall/locale/es/LC_MESSAGES
/usr/local/lib/checkinstall/locale/es/LC_MESSAGES/checkinstall.mo
/usr/local/lib/checkinstall/locale/id
/usr/local/lib/checkinstall/locale/id/LC_MESSAGES
/usr/local/lib/checkinstall/locale/id/LC_MESSAGES/checkinstall.mo
/usr/local/lib/checkinstall/locale/it
/usr/local/lib/checkinstall/locale/it/LC_MESSAGES
/usr/local/lib/checkinstall/locale/it/LC_MESSAGES/checkinstall.mo
/usr/local/lib/checkinstall/locale/ja
/usr/local/lib/checkinstall/locale/ja/LC_MESSAGES
/usr/local/lib/checkinstall/locale/ja/LC_MESSAGES/checkinstall.mo
/usr/local/lib/checkinstall/locale/no
/usr/local/lib/checkinstall/locale/no/LC_MESSAGES
/usr/local/lib/checkinstall/locale/no/LC_MESSAGES/checkinstall.mo
/usr/local/lib/checkinstall/locale/pt_BR
/usr/local/lib/checkinstall/locale/pt_BR/LC_MESSAGES
/usr/local/lib/checkinstall/locale/pt_BR/LC_MESSAGES/checkinstall.mo
/usr/local/lib/checkinstall/locale/ru
/usr/local/lib/checkinstall/locale/ru/LC_MESSAGES
/usr/local/lib/checkinstall/locale/ru/LC_MESSAGES/checkinstall.mo
/usr/local/lib/checkinstall/locale/zh_CN
/usr/local/lib/checkinstall/locale/zh_CN/LC_MESSAGES
/usr/local/lib/checkinstall/locale/zh_CN/LC_MESSAGES/checkinstall.mo
/usr/local/lib/installwatch.so
/usr/local/sbin
/usr/local/sbin/checkinstall
/usr/local/sbin/makepak

きちんとアンインストールされる事を確認

# rpm -e checkinstall
# rpm -q checkinstall
package checkinstall is not installed
# which checkinstall
/usr/bin/which: no checkinstall in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin)

途中で生成したシンボリックリンクがアンインストールされないのはご愛敬(´・ω・`)