CentOS下安裝checkinstall
技術(shù)支持服務(wù)電話:15308000360 【7x24提供運維服務(wù),解決各類系統(tǒng)/軟硬件疑難技術(shù)問題】
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報錯 報錯內(nèi)容為: /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出現(xiàn)該錯誤需要修改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 **) ) {完成后再進(jìn)行make即可。