安装 memcached 时出现问题

安装 memcached 时出现问题

我正在尝试按照说明进行操作这里在 CentOS 机器上安装 Memcached,但我运气不太好。

说明说首先启用 rpmforge 存储库如下:

rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

看上去一切顺利。

然后他们说使用 yum 安装 memcached:

yum -y install memcached

这将获取各个镜像站点的下载速度,然后显示“设置安装过程”,最后显示“没有可用的 memcached 包”。

我在这里做错了什么?

编辑:这些是我的 /etc/yum.conf 文件的内容:

root@vps-1077739-6497 [/etc/sysconfig]# cat /etc/yum.conf
[main]
exclude=apache* bind-chroot courier* dovecot* exim* filesystem httpd* mod_ssl* mysql* nsd* perl* php* proftpd* pure-ftpd* ruby* spamassassin* squirrelmail*
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yum

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

installonly_limit = 5

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

答案1

Memcached 位于 rpmforge-extras 存储库中,默认情况下未启用。

Installing:
 memcached                              i386                         1.4.7-1.el5.rfx                         rpmforge-extras                        79 k

您需要编辑文件 /etc/yum.repos.d/rpmforge.repo 并在 [rpmforge-extras] 部分中将“enabled = 1”替换为“enabled = 0”,然后重新运行命令 yum -y install memcached。

您的 /etc/yum.repos.d/rpmforge.repo 应该如下所示:

### Name: RPMforge RPM Repository for RHEL 5 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = RHEL $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

[rpmforge-extras]
name = RHEL $releasever - RPMforge.net - extras
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/extras
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge-extras
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extras
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

[rpmforge-testing]
name = RHEL $releasever - RPMforge.net - testing
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/testing
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge-testing
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-testing
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1

答案2

很难说你做错了什么。根据http://rpm.pbone.net/index.php3、RHEL5 和 CentOS 6(以及其他版本)都提供了 memcached。CentOS5 已将其包含在测试分支中。如果您遇到问题,请在您的发行版中搜索“memcached”,这样您就可以直接下载可用的版本。

相关内容