解决centos yum安装"No package nginx available."问题

问题描述:

[root@Centos ~]# yum install nginx
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * addons: mirror.bit.edu.cn
 * base: mirrors.btte.net
 * extras: mirrors.btte.net
 * updates: mirror.bit.edu.cn
Setting up Install Process
No package nginx available.
Nothing to do

问题原因:

nginx位于第三方的yum源里面,而不在centos官方yum源里面

解决方法:

安装epel(Extra Packages for Enterprise Linux)

a、去epel网站http://fedoraproject.org/wiki/EPEL下载

b、我的系统是centos5.7,cpu是x86_64,所以我下载的是wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

       如果是centos6, 则应该下载 wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

c、安装epel

       rpm -ivh epel-release-5-4.noarch.rpm

再次执行 yum install nginx,则会提示安装成功了

注:

epel的安装跟centos的系统版本、cpu硬件架构有关,

    查看系统版本(lsb-release -a),

    查看cpu硬件架构(arch)

epel它是RHEL 的 Fedora 软件仓库,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目。装上了 EPEL,就像在 Fedora 上一样,可以通过 yum install package-name,随意安装软件。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值