您好,登錄后才能下訂單哦!
怪不得oldboy不支持初學者用RHEL。
這段時間在2臺虛擬機上分別通過CentOS5.8和RHEL6.0安裝nagios的客戶端,CentOS一切順利。但是,RHEL不斷給我制造麻煩。前幾天在RHEL環境yum安裝mysql遇到問題,耽誤2天時間。昨晚又因為在RHEL上安裝dos2unix命令,昨晚加上今天下午又折騰1個小時。
今天凌晨通過下載軟件包,編譯安裝始終報錯。今天下午在百度搜索yum安裝這個命令,也不怎么得要領。于是又嘗試直接通過yum指定“dos2unix*”(執行“yum -y install dos2unix*”命令),沒想到,竟然安裝成功,后面的測試也沒有問題。
昨晚折騰到0:40,實在不想睡得太晚。雖然有些不甘心,但還是收拾收拾準備就寢。那時候,就又開始猶豫:到底要不要堅持繼續在RHEL上安裝nagios客戶端。即使次日把dos2unix命令成功安裝,后面可能還會遇到其它問題。但是,轉念再想:發現問題,解決問題的過程,正是自己提高的過程。畢竟,工作基本落實,不再為生計擔心。再花些時間解決這類小問題,應該也沒什么大不了的。
況且,linux本身就是各類小知識的繁雜集合。如果小問題都不能處理,大問題遇到的時候,更抓瞎。
為什么RHEL6沒有dos2unix這個命令呢?是我當初在安裝系統的時候沒有選擇好軟件包的原因嗎?天知道……
----------------------------------------開始說正事----------------------------------------------
[root@nagios_client02 nagios]# dos2unix /usr/local/nagios/libexec/check_memory.pl -bash: dos2unix: command not found [root@nagios_client02 nagios]# dos2unix /usr/local/nagios/libexec/check_iostat -bash: dos2unix: command not found [root@nagios_client02 nagios]# cd ..
執行dos2unix命令,提示命令沒有找到。可能是dos2unix在RHEL環境沒有安裝。
在百度搜索安裝dos2unix命令,根據文檔:“http://blog.csdn.net/bluewhale1/article/details/8074978——dos2unix命令找不到怎么辦”操作。
在http://linux.softpedia.com/progDownload/Dos2Unix-Download-5519.html下載hd2u-1.0.0.tgz包。
下載頁面全部都是英文內容,經過摸索,這里簡單說明下載步驟:點擊左邊的“DOWNLOAD”按紐,右邊的“DOWNLOAD LOCATIONS:”才能顯示出來。點擊“Sources mirror 1(tgz)”鏈接,進入下一級頁面,過一段時間,就會自動彈出下載對話框。
[root@nagios_client02 tools]# wget http://terminus.sk/~hany/_data/hd2u/hd2u-1.0.0.tgz --2014-09-07 00:03:11-- http://terminus.sk/~hany/_data/hd2u/hd2u-1.0.0.tgz Resolving terminus.sk... 92.240.244.10 Connecting to terminus.sk|92.240.244.10|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 54461 (53K) [application/x-gzip] Saving to: `hd2u-1.0.0.tgz' 100%[===========================================================================================================================>] 54,461 248K/s in 0.2s 2014-09-07 00:03:28 (248 KB/s) - `hd2u-1.0.0.tgz' saved [54461/54461] [root@nagios_client02 tools]# ll hd2u-1.0.0.tgz -rw-r--r-- 1 root root 54461 Mar 15 2005 hd2u-1.0.0.tgz [root@nagios_client02 tools]# tar zxvf hd2u-1.0.0.tgz hd2u-1.0.0/ hd2u-1.0.0/configure hd2u-1.0.0/dos2unix.c hd2u-1.0.0/NEWS hd2u-1.0.0/config.h.in hd2u-1.0.0/packaging/ hd2u-1.0.0/packaging/hd2u.spec hd2u-1.0.0/CREDITS hd2u-1.0.0/configure.in hd2u-1.0.0/README hd2u-1.0.0/COPYING hd2u-1.0.0/AUTHORS hd2u-1.0.0/install-sh hd2u-1.0.0/INSTALL hd2u-1.0.0/Makefile.in hd2u-1.0.0/TODO hd2u-1.0.0/ChangeLog [root@nagios_client02 tools]# cd hd2u-1.0.0 [root@nagios_client02 hd2u-1.0.0]# ./configure Configuring hd2u 1.0.0 checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for a BSD-compatible install... /usr/bin/install -c checking for getopt_long in -lpopt... no configure: error: *** libpopt not found
配置報錯。
[root@nagios_client02 hd2u-1.0.0]# make make: *** No targets specified and no makefile found. Stop.
編譯也有問題。
在“http://rpm.pbone.net/index.php3/stat/4/idpl/17960519/dir/other/com/popt-1.14-2rt.x86_64.rpm.html”頁面下載popt-1.14-2rt.x86_64.rpm包。
在打開的頁面里,右鍵單擊“popt-1.14-2rt.x86_64.rpm”鏈接,在彈出的快捷菜單里選擇“復制鏈接地址”,就可以在linux環境使用wget命令下載這個包。
[root@nagios_client02 hd2u-1.0.0]# wget ftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/r/ro/roblinux/64-32_pkg/base/x86_64/popt-1.14-2rt.x86_64.rpm --2014-09-07 00:09:30-- ftp://ftp.pbone.net/mirror/ftp.sourceforge.net/pub/sourceforge/r/ro/roblinux/64-32_pkg/base/x86_64/popt-1.14-2rt.x86_64.rpm => `popt-1.14-2rt.x86_64.rpm' Resolving ftp.pbone.net... 85.14.85.4 Connecting to ftp.pbone.net|85.14.85.4|:21... connected. Logging in as anonymous ... Logged in! ==> SYST ... done. ==> PWD ... done. ==> TYPE I ... done. ==> CWD (1) /mirror/ftp.sourceforge.net/pub/sourceforge/r/ro/roblinux/64-32_pkg/base/x86_64 ... done. ==> SIZE popt-1.14-2rt.x86_64.rpm ... 75973 ==> PASV ... done. ==> RETR popt-1.14-2rt.x86_64.rpm ... done. Length: 75973 (74K) (unauthoritative) 100%[===========================================================================================================================>] 75,973 7.21K/s in 10s 2014-09-07 00:10:30 (7.21 KB/s) - `popt-1.14-2rt.x86_64.rpm' saved [75973] [root@nagios_client02 hd2u-1.0.0]# ll popt-1.14-2rt.x86_64.rpm -rw-r--r-- 1 root root 75973 Sep 7 00:10 popt-1.14-2rt.x86_64.rpm [root@nagios_client02 hd2u-1.0.0]# mv popt-1.14-2rt.x86_64.rpm ../ [root@nagios_client02 hd2u-1.0.0]# cd .. [root@nagios_client02 tools]# ll popt-1.14-2rt.x86_64.rpm -rw-r--r-- 1 root root 75973 Sep 7 00:10 popt-1.14-2rt.x86_64.rpm [root@nagios_client02 tools]# rpm -ivh popt-1.14-2rt.x86_64.rpm Preparing... ########################################### [100%] package popt-1.14-2rt.x86_64 is intended for a x86_64 architecture file /usr/share/locale/cs/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/da/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/de/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/es/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/fr/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/ga/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/gl/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/hu/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/is/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/it/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/ja/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/ko/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/nb/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/nl/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/pl/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/pt/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/ro/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/ru/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/sk/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/sl/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/sv/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/tr/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/uk/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/vi/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/wa/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686 file /usr/share/locale/zh_CN/LC_MESSAGES/popt.mo from install of popt-1.14-2rt.x86_64 conflicts with file from package popt-1.13-7.el6.i686
通過輸出發現,這個包應該是用于64位系統,而虛擬機里的RHEL是32位系統。安裝也有問題。
[root@nagios_client02 tools]# cd hd2u-1.0.0 [root@nagios_client02 hd2u-1.0.0]# ./configure Configuring hd2u 1.0.0 checking for gcc... gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for a BSD-compatible install... /usr/bin/install -c checking for getopt_long in -lpopt... no configure: error: *** libpopt not found [root@nagios_client02 hd2u-1.0.0]# make make: *** No targets specified and no makefile found. Stop. [root@nagios_client02 hd2u-1.0.0]# make install make: *** No rule to make target `install'. Stop. [root@nagios_client02 hd2u-1.0.0]# cd ..
配置、編譯和安裝都有報錯。
也嘗試找過32位版本的這個軟件包,但不知道是找到的版本有問題,還是版本號不一致。都是在執行“rpm -ivh”命令時,沒有執行成功。
嘗試使用yum安裝dos2unix,意外成功。
[root@nagios_client02 tools]# yum -y install dos2unix* Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.grandcloud.cn * extras: ftp.yzu.edu.tw * updates: mirrors.grandcloud.cn base | 3.7 kB 00:00 extras | 3.3 kB 00:00 updates | 3.4 kB 00:00 Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package dos2unix.i686 0:3.1-37.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ===================================================================================================================================================================== Package Arch Version Repository Size ===================================================================================================================================================================== Installing: dos2unix i686 3.1-37.el6 base 15 k Transaction Summary ===================================================================================================================================================================== Install 1 Package(s) Total download size: 15 k Installed size: 17 k Downloading Packages: dos2unix-3.1-37.el6.i686.rpm | 15 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : dos2unix-3.1-37.el6.i686 1/1 Verifying : dos2unix-3.1-37.el6.i686 1/1 Installed: dos2unix.i686 0:3.1-37.el6 Complete! [root@nagios_client02 tools]# whereis dos2unix dos2unix: /usr/bin/dos2unix /usr/share/man/man1/dos2unix.1.gz [root@nagios_client02 tools]# dos2unix /usr/local/nagios/libexec/check_memory.pl dos2unix: converting file /usr/local/nagios/libexec/check_memory.pl to UNIX format ... [root@nagios_client02 tools]# dos2unix /usr/local/nagios/libexec/check_iostat dos2unix: converting file /usr/local/nagios/libexec/check_iostat to UNIX format ...
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。