CentOS下安装checkinstall
技术支持服务电话:15308000360 【7x24提供运维服务,解决各类系统/软硬件疑难技术问题】
Checkinstall的安装 本次checkinstall版本是1.6.2,可以按下面的方式下载安装。
wget http://asic-linux.com.mx/~izto/checkinstall/files/source/checkinstall-1.6.2.tar.gz tar zxvf checkinstall-1.6.2.tar.gz cd checkinstall-1.6.2 make && make install不过我在centos6.5 X64上安装时,并不像上面写的那么简单就可以使用,在安装过程中可能会遇到如下的问题,需要解决。
问题1、make时msgfmt报错 报错内容为: /bin/sh: line 5: msgfmt: command not found make: *** [all] Error 1 这里可以通过安装gettext包解决
wget http://ftp.gnu.org/gnu/gettext/gettext-0.19.8.tar.gz ./configure make make install问题2、make时installwatch报错
[root@localhost checkinstall-1.6.2]# make for file in locale/checkinstall-*.po ; do case ${file} in locale/checkinstall-template.po) ;; *) out=`echo $file | sed -s 's/po/mo/'` ; msgfmt -o ${out} ${file} ; if [ $? != 0 ] ; then exit 1 ; fi ; ;; esac ; done make -C installwatch make[1]: Entering directory `/usr/local/src/checkinstall-1.6.2/installwatch' gcc -Wall -c -D_GNU_SOURCE -DPIC -fPIC -D_REENTRANT -DVERSION="0.7.0beta7" installwatch.c installwatch.c:2942: error: conflicting types for ‘readlink’ /usr/include/unistd.h:828: note: previous declaration of ‘readlink’ was here installwatch.c:3080: error: conflicting types for ‘scandir’ /usr/include/dirent.h:252: note: previous declaration of ‘scandir’ was here make[1]: *** [installwatch.o] Error 1 make[1]: Leaving directory `/usr/local/src/checkinstall-1.6.2/installwatch' make: *** [all] Error 2出现该错误需要修改installwatch/installwatch.c文件,具体需要修改的部分如下:
将101行处修改 static int (*true_scandir)( const char *,struct dirent ***, int (*)(const struct dirent *), int (*)(const void *,const void *)); 改为: static int (*true_scandir)( const char *,struct dirent ***, int (*)(const struct dirent *), int (*)(const struct dirent **,const struct dirent **)); 将121行处修改: static int (*true_scandir64)( const char *,struct dirent64 ***, int (*)(const struct dirent64 *), int (*)(const void *,const void *)); 改为: static int (*true_scandir64)( const char *,struct dirent64 ***, int (*)(const struct dirent64 *), int (*)(const struct dirent64 **,const struct dirent64 **)); 将2941行修改: #if (GLIBC_MINOR <= 4) 改为 #if (0) 将3080行修改: int scandir( const char *dir,struct dirent ***namelist, int (*select)(const struct dirent *), int (*compar)(const void *,const void *) ) { 改为: int scandir( const char *dir,struct dirent ***namelist, int (*select)(const struct dirent *), int (*compar)(const struct dirent **,const struct dirent **) ) { 将3692行修改: int scandir64( const char *dir,struct dirent64 ***namelist, int (*select)(const struct dirent64 *), int (*compar)(const void *,const void *) ) { 改为: int scandir64( const char *dir,struct dirent64 ***namelist, int (*select)(const struct dirent64 *), int (*compar)(const struct dirent64 **,const struct dirent64 **) ) {完成后再进行make即可。