最簡單的安裝方法就是: tar -zxvf *.gz tar -jxvf *.bz2 cd gettext-0.17 (或者glib-2.15.一、pango-1.19.0、atk-1.20.0、jpegsrc-v6b、tiff-3.8.二、gtk+-2.12.4) ./configure --prefix=/usr (記住這裏必定是「/usr」,不是安裝在/usr下面的會很麻煩,後面就講這個) make sudo make install
checking for pkg-config/usr/bin/pkg-config checking for glib-2.0>=2.4.0 atk >=1.0.1 pango >=1.4.0Package glib-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `glib-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'glib-2.0' found
configure: error: Library requirements (glib-2.0 >= 2.4.0 atk >= 1.0.1 pango >= 1.4.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them. [root@NEWLFS gtk+-2.4.13]# 很明顯,上面這段說明,沒有找到glib-2.4.x,而且提示應該將glib-2.0.pc加入到PKG_CONFIG_PATH下。 究竟這個pkg-config PKG_CONFIG_PATH glib-2.0.pc 是作什麼的呢? let me tell you ^_^ 先說說它是哪冒出來的,當安裝了pkgconfig-x.x.x這個包後,就多出了pkg-config,它就是須要PKG_CONFIG_PATH的東東 pkgconfig-x.x.x又是作什麼的? 來看一段說明:
The pkgconfig package contains tools for passing the include path and/or library paths to build tools during the make file execution.
pkg-config is a function that returns meta information for the specified library.
The default setting for PKG_CONFIG_PATH is /usr/lib/pkgconfig because of the prefix we use to install pkgconfig. You may add to PKG_CONFIG_PATH by exporting additional paths on your system where pkgconfig files are installed. Note that PKG_CONFIG_PATH is only needed when compiling packages, not during run-time.
我想看過這段說明後,你已經大概瞭解了它是作什麼的吧。 其實pkg-config就是向configure程序提供系統信息的程序,好比軟件的版本啦,庫的版本啦,庫的路徑啦,等等 這些信息只是在編譯其間使用。你能夠 ls /usr/lib/pkgconfig 下,會看到許多的*.pc,用文本編輯器打開 會發現相似下面的信息:
#./configure提示: checking for GLIB - version >=2.5.7 *** 'pkg-config --modversion glib-2.0' returned 2.12.0, but GLIB (2.10.3) *** was found!If pkg-config was correct, then it is best *** to remove the old version of GLib. You may also be able to fix the error *** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing ***/etc/ld.so.conf. Make sure you have run ldconfig if that is *** required on your system. ***If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH *** to point to the correct configuration files no configure: error: *** GLIB 2.5.7 or better is required. The latest version of *** GLIB is always available from ftp://ftp.gtk.org/. If GLIB is installed *** but not in the same location as pkg-config add the location of the file *** glib-2.0.pc to the environment variable PKG_CONFIG_PATH.
若是不是rpm或源碼包已經被刪,那隻能直接刪文件了。通常包括以下文件: a) /usr/lib/libglib-* b) /usr/lib/pkgconfig/glib-2.0.pc c) /usr/iclude/glib-2.0 d) /usr/share/glib-2.0 e) /usr/share/locale/*/LC_MESSAGES/glib20.mo 差很少就這些了,刪除以後就能夠繼續安裝新版glib了,安裝完以後,能夠查看安裝目錄下的文件,而後到系統默認路徑下去找相應的舊版的文件,刪除之,這樣就刪乾淨了。 刪除以前最後作一下記錄,或乾脆備份一下,以防刪錯。而且建議在原來的位置創建一個名爲原來的文件名的且指向新文件的連接文件,由於或許某些程序會直接訪問系統默認目錄。