1.在使用上面方法安装之前还是用了yum安装,但是出错了This system is not registered with RHN.
[iyunv@localhost ~]# yum install httpd
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
No package httpd available.
Nothing to do
解决方案:
1.卸载redhat自带的yum组件
[iyunv@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps
2.安装centos的yum包
[iyunv@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
[iyunv@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
[iyunv@localhost ~]# wget http://centos.ustc.edu.cn/centos/5/os/i386/CentOS/yum-metadata-parser-1.1.2-4.el5.i386.rpm
[iyunv@localhost ~]# rpm -ivh *.rpm
warning: yum-3.2.22-37.el5.centos.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:yum-metadata-parser ########################################### [ 33%]
2:yum-fastestmirror ########################################### [ 67%]
3:yum ########################################### [100%] 3. 下载更新源,并存放在系统目录中
[iyunv@localhost ~]# wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
[iyunv@localhost ~]#mv CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo
4.生成缓存并进行安装
[iyunv@localhost ~]# yum makecache
[iyunv@localhost ~]# yum install httpd
2.在使用上述解决方法时要分清你的操作系统是32位还是64位的。
不然会有下述问题
今天在redhat 5.4_64系统替换yum源的时候出现:
[iyunv@mail yum.repos.d]# yum clean metadata
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
/usr/lib/python2.4/site-packages/_sqlitecache.so: wrong ELF class: ELFCLASS32
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.4.3 (#1, Jun 11 2009, 14:09:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq
刚开始我以为是我的python模块的版本低,经过百度一顿分析,原来是我太大意了,因为我的系统是64位的,可笑的是我安装的四个文件分别是: yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
yum-3.2.22-40.el5.centos.noarch.rpm
yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
其中黑色字体的竟然是32位的包,后来全部又从网上下载了一个全新的包,
网址:
http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-3.2.22-40.el5.centos.noarch.rpm
http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-fastestmirror-1.1.16-21.el5.centos.noarch.rpm
http://mirrors.163.com/centos/5/os/x86_64/CentOS/yum-metadata-parser-1.1.2-4.el5.x86_64.rpm
卸载原来的yum
[iyunv@mail yum-64]# rpm -qa|grep yum|xargs rpm -e --nodeps
然后从新安装,一些OK了,
3.解决了上述问题之后,最后在启动jenkins的时候。报了一个关于java版本太低的错误
enkins requires Java7 or later, but you are running 1.4.0_36-b36 from /usr/lib/jvm/java-4-openjdk-amd64/jre