centos6 yum 安装nginx 不成功解决办法

转自  http://wlheihei.com/view/64


[root@51ou.com yum.repos.d]# yum install nginx
Loaded plugins: fastestmirror, priorities, refresh-packagekit, security
Loading mirror speeds from cached hostfile
163 packages excluded due to repository priority protections
Setting up Install Process
No package nginx available.
Error: Nothing to do

没法使用yum安装

百度之,找到的第一个答案是没有安装EPEL,则安装之

    
[root@51ou.com yum.repos.d]# rpm -Uvh ftp://ftp.univie.ac.at/systems/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
Retrieving ftp://ftp.univie.ac.at/systems/linux/fedora/epel/6/x86_64/epel-release-6-

8.noarch.rpm
Preparing...                ##################
###### [100%]
package epel-release-6-8.noarch is already installed

之后照样执行yum install nginx依然错误

之后发现这台机器上已经编译安装过nginx,找一台新机器,尝试后依然错误。

    
[root@51ou.com local]# yum info nginx
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.cug.edu.cn
 * extras: mirrors.cug.edu.cn
 * updates: mirrors.cug.edu.cn
Error: No matching Packages to list

经查询原来是没有nginx的yum源包

直接安装一个nginx的yum源文件

    
[root@51ou.com local]# rpm -ivh http://nginx.org/packages/centos/
6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
Retrieving http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-

0.el6.ngx.noarch.rpm
warning: /var/tmp/rpm-tmp.y29UIV: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY
Preparing...                ######################## [100%]
   1:nginx-release-centos   ########################### [100%]

    
[root@51ou.com local]# cd /etc/yum.repos.d/
[root@51ou.com yum.repos.d]# ll
总用量 20
-rw-r--r--. 1 root root 1926 12月  9 2011 CentOS-Base.repo
-rw-r--r--. 1 root root  637 12月  9 2011 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root  626 12月  9 2011 CentOS-Media.repo
-rw-r--r--. 1 root root  113 10月 14 2011 nginx.repo
-rw-r--r--. 1 root root 1250 11月  8 17:40 puppetlabs.repo

就可以使用yum install nginx安装了
    
[root@51ou.com local]# yum install nginx



Setting up Install Process

Loading mirror speeds from cached hostfile

 * epel: mirrors.opencas.cn

nginx                                                                                                                                                                        | 2.9 kB     00:00     

nginx/primary_db                                                                                                                                                             | 8.3 kB     00:00     

Resolving Dependencies

--> Running transaction check

---> Package nginx.x86_64 0:1.8.1-1.el6.ngx will be installed

--> Finished Dependency Resolution


Dependencies Resolved


====================================================================================================================================================================================================

 Package                                     Arch                                         Version                                                 Repository                                   Size

====================================================================================================================================================================================================

Installing:

 nginx                                       x86_64                                       1.8.1-1.el6.ngx                                         nginx                                       352 k


Transaction Summary

====================================================================================================================================================================================================

Install       1 Package(s)


Total download size: 352 k

Installed size: 872 k

Is this ok [y/N]: y

Downloading Packages:

nginx-1.8.1-1.el6.ngx.x86_64.rpm                                                                                                                                             | 352 kB     00:12     

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

  Installing : nginx-1.8.1-1.el6.ngx.x86_64                                                                                                                                                     1/1 

----------------------------------------------------------------------


Thanks for using nginx!


Please find the official documentation for nginx here:

* http://nginx.org/en/docs/


Commercial subscriptions for nginx are available on:

* http://nginx.com/products/


----------------------------------------------------------------------

  Verifying  : nginx-1.8.1-1.el6.ngx.x86_64                                                                                                                                                     1/1 


Installed:

  nginx.x86_64 0:1.8.1-1.el6.ngx                                                                                                                                                                    


Complete!


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值