设为首页 收藏本站
查看: 3669|回复: 0

[经验分享] 在32位RHEL6安装dos2unix的纠结过程

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2014-9-9 08:41:45 | 显示全部楼层 |阅读模式
怪不得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这个命令呢?是我当初在安装系统的时候没有选择好软件包的原因吗?天知道……
----------------------------------------开始说正事----------------------------------------------
1
2
3
4
5
[iyunv@nagios_client02 nagios]# dos2unix /usr/local/nagios/libexec/check_memory.pl
-bash: dos2unix: command not found
[iyunv@nagios_client02 nagios]# dos2unix /usr/local/nagios/libexec/check_iostat
-bash: dos2unix: command not found
[iyunv@nagios_client02 nagios]# cd ..



  执行dos2unix命令,提示命令没有找到。可能是dos2unix在RHEL环境没有安装。
  在百度搜索安装dos2unix命令,根据文档:“http://blog.iyunv.com/bluewhale1/article/details/8074978——dos2unix命令找不到怎么办”操作。
  在http://linux.softpedia.com/progDownload/Dos2Unix-Download-5519.html下载hd2u-1.0.0.tgz包。
wKiom1QMMn_w4l32AAc8tYEZbog000.jpg
  下载页面全部都是英文内容,经过摸索,这里简单说明下载步骤:点击左边的“DOWNLOAD”按纽,右边的“DOWNLOAD LOCATIONS:”才能显示出来。点击“Sources mirror 1(tgz)”链接,进入下一级页面,过一段时间,就会自动弹出下载对话框。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
[iyunv@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]
[iyunv@nagios_client02 tools]# ll hd2u-1.0.0.tgz
-rw-r--r-- 1 root root 54461 Mar 15  2005 hd2u-1.0.0.tgz
[iyunv@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
[iyunv@nagios_client02 tools]# cd hd2u-1.0.0
[iyunv@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



  配置报错。
1
2
[iyunv@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命令下载这个包。
wKioL1QMM2zSZVvqAAYzrJjcIos350.jpg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
[iyunv@nagios_client02 hd2u-1.0.0]# wget ftp://ftp.pbone.net/mirror/ftp.s ... 1.14-2rt.x86_64.rpm
--2014-09-07 00:09:30--  ftp://ftp.pbone.net/mirror/ftp.s ... 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]
[iyunv@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
[iyunv@nagios_client02 hd2u-1.0.0]# mv popt-1.14-2rt.x86_64.rpm ../
[iyunv@nagios_client02 hd2u-1.0.0]# cd ..
[iyunv@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
[iyunv@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位系统。安装也有问题。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[iyunv@nagios_client02 tools]# cd hd2u-1.0.0
[iyunv@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
[iyunv@nagios_client02 hd2u-1.0.0]# make
make: *** No targets specified and no makefile found.  Stop.
[iyunv@nagios_client02 hd2u-1.0.0]# make install
make: *** No rule to make target `install'.  Stop.
[iyunv@nagios_client02 hd2u-1.0.0]# cd ..



  配置、编译和安装都有报错。
  也尝试找过32位版本的这个软件包,但不知道是找到的版本有问题,还是版本号不一致。都是在执行“rpm -ivh”命令时,没有执行成功。
  尝试使用yum安装dos2unix,意外成功。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
[iyunv@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!
[iyunv@nagios_client02 tools]# whereis dos2unix
dos2unix: /usr/bin/dos2unix /usr/share/man/man1/dos2unix.1.gz
[iyunv@nagios_client02 tools]# dos2unix /usr/local/nagios/libexec/check_memory.pl
dos2unix: converting file /usr/local/nagios/libexec/check_memory.pl to UNIX format ...
[iyunv@nagios_client02 tools]# dos2unix /usr/local/nagios/libexec/check_iostat
dos2unix: converting file /usr/local/nagios/libexec/check_iostat to UNIX format ...



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-24576-1-1.html 上篇帖子: linux 修改ip、域名解析、ping不通 下篇帖子: CentOS服务器下JavaEE环境搭建指南(远程桌面+JDK+Tomcat+MySQL)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表