溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

在32位RHEL6安裝dos2unix的糾結(jié)過(guò)程

發(fā)布時(shí)間:2020-07-23 02:09:51 來(lái)源:網(wǎng)絡(luò) 閱讀:1897 作者:YuriGagarin 欄目:系統(tǒng)運(yùn)維

怪不得oldboy不支持初學(xué)者用RHEL。

  這段時(shí)間在2臺(tái)虛擬機(jī)上分別通過(guò)CentOS5.8和RHEL6.0安裝nagios的客戶(hù)端,CentOS一切順利。但是,RHEL不斷給我制造麻煩。前幾天在RHEL環(huán)境yum安裝mysql遇到問(wèn)題,耽誤2天時(shí)間。昨晚又因?yàn)樵赗HEL上安裝dos2unix命令,昨晚加上今天下午又折騰1個(gè)小時(shí)。

  今天凌晨通過(guò)下載軟件包,編譯安裝始終報(bào)錯(cuò)。今天下午在百度搜索yum安裝這個(gè)命令,也不怎么得要領(lǐng)。于是又嘗試直接通過(guò)yum指定“dos2unix*”(執(zhí)行“yum -y install dos2unix*”命令),沒(méi)想到,竟然安裝成功,后面的測(cè)試也沒(méi)有問(wèn)題。

  昨晚折騰到0:40,實(shí)在不想睡得太晚。雖然有些不甘心,但還是收拾收拾準(zhǔn)備就寢。那時(shí)候,就又開(kāi)始猶豫:到底要不要堅(jiān)持繼續(xù)在RHEL上安裝nagios客戶(hù)端。即使次日把dos2unix命令成功安裝,后面可能還會(huì)遇到其它問(wèn)題。但是,轉(zhuǎn)念再想:發(fā)現(xiàn)問(wèn)題,解決問(wèn)題的過(guò)程,正是自己提高的過(guò)程。畢竟,工作基本落實(shí),不再為生計(jì)擔(dān)心。再花些時(shí)間解決這類(lèi)小問(wèn)題,應(yīng)該也沒(méi)什么大不了的。

  況且,linux本身就是各類(lèi)小知識(shí)的繁雜集合。如果小問(wèn)題都不能處理,大問(wèn)題遇到的時(shí)候,更抓瞎。

  為什么RHEL6沒(méi)有dos2unix這個(gè)命令呢?是我當(dāng)初在安裝系統(tǒng)的時(shí)候沒(méi)有選擇好軟件包的原因嗎?天知道……

----------------------------------------開(kāi)始說(shuō)正事----------------------------------------------

[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 ..

  執(zhí)行dos2unix命令,提示命令沒(méi)有找到。可能是dos2unix在RHEL環(huán)境沒(méi)有安裝。
  在百度搜索安裝dos2unix命令,根據(jù)文檔:“http://blog.csdn.net/bluewhale1/article/details/8074978——dos2unix命令找不到怎么辦”操作。
  在http://linux.softpedia.com/progDownload/Dos2Unix-Download-5519.html下載hd2u-1.0.0.tgz包。

在32位RHEL6安裝dos2unix的糾結(jié)過(guò)程

  下載頁(yè)面全部都是英文內(nèi)容,經(jīng)過(guò)摸索,這里簡(jiǎn)單說(shuō)明下載步驟:點(diǎn)擊左邊的“DOWNLOAD”按紐,右邊的“DOWNLOAD LOCATIONS:”才能顯示出來(lái)。點(diǎn)擊“Sources mirror 1(tgz)”鏈接,進(jìn)入下一級(jí)頁(yè)面,過(guò)一段時(shí)間,就會(huì)自動(dòng)彈出下載對(duì)話框。

[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

  配置報(bào)錯(cuò)。

[root@nagios_client02 hd2u-1.0.0]# make
make: *** No targets specified and no makefile found.  Stop.

  編譯也有問(wèn)題。
  在“http://rpm.pbone.net/index.php3/stat/4/idpl/17960519/dir/other/com/popt-1.14-2rt.x86_64.rpm.html”頁(yè)面下載popt-1.14-2rt.x86_64.rpm包。
  在打開(kāi)的頁(yè)面里,右鍵單擊“popt-1.14-2rt.x86_64.rpm”鏈接,在彈出的快捷菜單里選擇“復(fù)制鏈接地址”,就可以在linux環(huán)境使用wget命令下載這個(gè)包。

在32位RHEL6安裝dos2unix的糾結(jié)過(guò)程

[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

  通過(guò)輸出發(fā)現(xiàn),這個(gè)包應(yīng)該是用于64位系統(tǒng),而虛擬機(jī)里的RHEL是32位系統(tǒng)。安裝也有問(wèn)題。

[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 ..

  配置、編譯和安裝都有報(bào)錯(cuò)。
  也嘗試找過(guò)32位版本的這個(gè)軟件包,但不知道是找到的版本有問(wèn)題,還是版本號(hào)不一致。都是在執(zhí)行“rpm -ivh”命令時(shí),沒(méi)有執(zhí)行成功。
  嘗試使用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 ...
向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI