安装步骤
CentOS 6.5
安装epel软件仓库
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -ivh epel-release-6-8.noarch.rpm rpm -ivh remi-release-6.rpm
完成后检查是否安装成功
ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo
成功则返回如下列表:
/etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/remi.repo
开启 remi 软件仓库
vi /etc/yum.repos.d/remi.repo
编辑[remi]下的enabled选项从0设为1
[remi] ... enabled=1 ...
OK,现在可以使用了。
如果运行yum 时,出现如下报错:
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again
解决办法:
vi /etc/yum.repos.d/epel.repo
编辑[epel]下的baseurl前的#号去掉,mirrorlist前添加#号。正确配置如下:
[epel] name=Extra Packages for Enterprise Linux 6 – $basearch baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch ...
再运行
yum makecache
再次检查epel是否已经安装
yum repolist
返回软件仓库列表如下:
repo id repo name status
10gen 10gen Repository 274
base CentOS-6 - Base 6,575
epel Extra Packages for Enterprise Linux 6 - x86_64 11,836
extras CentOS-6 - Extras 48
remi Remi‘s RPM repository for Enterprise Linux 6 - x86_64 3,097
remi-safe Safe Remi‘s RPM repository for Enterprise Linux 6 - x86_64 534
rpmforge RHEL 6 - RPMforge.net - dag 4,718
updates CentOS-6 - Updates 958
repolist: 28,040
如果返回列表中包含 epel ,则说明你已成功安装。
最后,进行nodejs 和 npm 的安装:
yum install nodejs npm --enablerepo=epel
至此,所有安装完成。
本文出自 “企升创展” 博客,请务必保留此出处http://uppower.blog.51cto.com/1759096/1728700
原文地址:http://uppower.blog.51cto.com/1759096/1728700