[Linux] 用 rpm -qa 指令查詢某套件是否已安裝
有時候一個很簡單的問題,反而不知道怎麼解決…
像今天遇到編譯時出現 ncurses 的錯誤訊息:
checking for ncurses/ncurses.h... no configure: error: ncurses or ncursesw selected, but library not found (--without-ncurses to disable)
雖然錯誤訊息已經指出了 ncurses,可是不太可能沒有裝這個 library,
印象中其他東西在編譯時應該也有用到…
要怎麼確認系統中,有沒有 ncurses library 呢?
查了一下,原來就只要用 qpm -qa 指令來查就好了 Orz…
root@6d60840cc4a0 / # rpm -qa | egrep -i ncurses ncurses-base-5.9-13.20130511.el7.noarch ncurses-5.9-13.20130511.el7.x86_64 ncurses-libs-5.9-13.20130511.el7.x86_64
簡單的問題解決了,那既然有 ncruses 的 library,為什麼編譯又失敗呢?
找一下它要的那個 ncurses.h,原來是在 ncurses-devel 裡面,
所以只是安裝 ncurses 的話是沒有的:
root@6d60840cc4a0 / # yum provides */ncurses.h latrace-0.5.11-6.1.el7.i686 : LD_AUDIT feature frontend for glibc 2.4+ Repo : base Matched from: Filename : /etc/latrace.d/headers/ncurses.h latrace-0.5.11-6.1.el7.x86_64 : LD_AUDIT feature frontend for glibc 2.4+ Repo : base Matched from: Filename : /etc/latrace.d/headers/ncurses.h ncurses-devel-5.9-14.20130511.el7_4.i686 : Development files for the ncurses library Repo : base Matched from: Filename : /usr/include/ncursesw/ncurses.h Filename : /usr/include/ncurses.h Filename : /usr/include/ncurses/ncurses.h ncurses-devel-5.9-14.20130511.el7_4.x86_64 : Development files for the ncurses library Repo : base Matched from: Filename : /usr/include/ncursesw/ncurses.h Filename : /usr/include/ncurses.h Filename : /usr/include/ncurses/ncurses.h
問題解決了,下次要記得 rpm -qa 這個小指令呀~
參考資料:linux – How can I check if ncurses is installed? – Stack Overflow
(本頁面已被瀏覽過 867 次)