標籤:rpm htop
在CentOS6.5上用yum安裝htop,費了好大的勁都安裝不上。
先是yum install htop,提示如下
Setting up Install Process
No package top available.
Error: Nothing to do
然後指定yum源,把163上的yum源統統寫入repo檔案中,還是上面的提示,暫時沒辦法了。
上網查吧,剛好看到一篇文章有編譯安裝的過程,如下
下載htop原始碼檔案 wget http://sourceforge.net/projects/htop/files/latest/download
將檔案解壓 tar -xzf htop-1.0.2.tar.gz
進入解壓後的目錄 cd htop-1.0.2
運行./configure ,結果提示
configure: error: You may want to use --disable-unicode or install libncursesw.
安裝這個yum install -y ncurses-devel
5. 沒問題之後在命令列輸入make,再輸入make install,最後安裝完成。當然gcc必須在編譯之前確保已經安裝好。
運行htop試一下,已經可以運行。接下來拿htop練習一下rpm的用法。
rpm是linux下包的管理工具,包括安裝及查詢。
一般安裝的話,我們基本都是這樣用 rpm -ivh 包名 其中i 代表安裝,v代表可視過程,h代表進度,後面接我們要安裝的包名就可以。用rpm安裝包有個弊端,就是無法迴避依賴關係,所以安裝包最好用yum工具 yum install htop。這次主要練習rpm查詢用法。
查詢一個包是否安裝 rpm -q htop 顯示如下
[[email protected] ~]# rpm -q htop
package htop is not installed
看來編譯安裝的貌似無法查詢到(有待考證)
查詢gcc
[[email protected] ~]# rpm -q gcc
gcc-4.4.7-11.el6.x86_64
2. 查詢詳細資料
[[email protected] ~]# rpm -qi gcc
Name : gcc Relocations: (not relocatable)
Version : 4.4.7 Vendor: CentOS
Release : 11.el6 Build Date: Tue 14 Oct 2014 05:24:47 PM PDT
Install Date: Wed 31 Dec 2014 07:24:03 PM PST Build Host: c6b9.bsys.dev.centos.org
Group : Development/Languages Source RPM: gcc-4.4.7-11.el6.src.rpm
Size : 19495803 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ with exceptions
Signature : RSA/SHA1, Fri 17 Oct 2014 01:02:58 PM PDT, Key ID 0946fca2c105b9de
Packager : CentOS BuildSystem <http://bugs.centos.org>
URL : http://gcc.gnu.org
Summary : Various compilers (C, C++, Objective-C, Java, ...)
Description :
The gcc package contains the GNU Compiler Collection version 4.4.
You‘ll need this package in order to compile C code.
3. 列出產生的各個檔案
[[email protected] ~]# rpm -ql gcc
4. 列出產生的設定檔
[[email protected] ~]# rpm -qc gcc
4. 列出產生的協助檔案
[[email protected] ~]# rpm -qd gcc
以上所查到的內容都是由 /var/lib/rpm/ 所提供。
5. 還可以查詢某各檔案是哪個包產生的
[[email protected] ~]# rpm -qf /var/lib/dhcpd/dhcpd6.leases
dhcp-4.1.1-43.P1.el6.centos.x86_64
這裡要查詢的檔案必須使用絕對路徑
安裝htop及rpm工具使用