配置yum仓库路径

来源:互联网 发布:阿里云打开80端口 编辑:程序博客网 时间:2024/05/23 19:10
 

之前在RHEL 5.1上使用yum命令没有一次成功过。原来是RHEL 5.1的默认.repo文件(用于指定YUM仓库的路径):
/etc/yum.repos.d/rhel-debuginfo.repo
enabled=0。enabled=0表示禁用该仓库。gpgcheck=1表示使用签名,用于验证软件包是否是官方的。gpgkey=指定签名文件的路径。直接把enabled改为1还是不行。可能这个默认的软件仓库根本就没用(名字里都告诉你debug了)。

在网上找了个YUM仓库的路径:
http://centos.ustc.edu.cn/centos/5/os/i386/
注意,这个YUM仓库便是可连接的。首先你直接在浏览器中可以打开这个地址。其次,其目录下含repodata目录。repodata目录由createrepo命令产生,用于将当前目录目录配置为YUM仓库。

在/etc/yum.repos.d/目录下新建endoresu.repo文件,编辑内容如下:
[endoresu]
name=endoresu
baseurl=http://centos.ustc.edu.cn/centos/5/os/i386/
enable=1

不过比较遗憾的是,这个软件仓库是centos的。rhel5的镜像点不好找。目前还没找到。
不过为了验证,尝试使用yum来安装openwebmail。openwebmail是Linux下的一个邮箱网站,可以挂在apache上。使用openwebmail的前提是服务器上事先装了sendmail。

修改endoresu.repo内容如下:
[endoresu]
name=openwebmail
baseurl=http://openwebmail.org/openwebmail/download/redhat/rpm/release/
enable=1
gpgcheck=1
gpgkey=http://openwebmail.org/openwebmail/download/redhat/rpm/release/RPM-GPG-KEY-openwebmail

注意若路径含空格,无论是http还是file,都用“%20”代替,即看做网址。
直接使用yum install ...命令还是不能直接安装openwebmail,先装下面两个安装包:
http://openwebmail.org/openwebmail/download/redhat/rpm/release/perl-Text-Iconv/perl-Text-Iconv-1.7-1.el5.rf.i386.rpm
perl-suidperl-5.8.8-10.i386.rpm

然后就能使用yum install ...了:
# yum install openwebmail

原创粉丝点击