Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟件包


 

  Centos 7下安裝nginx,使用yum install nginx,提示沒有可用的軟件包。

復制代碼
18 (flaskApi) [root@67 flaskDemo]# yum -y install nginx
19 已加載插件:fastestmirror, langpacks
20 Loading mirror speeds from cached hostfile
21  * base: mirrors.aliyun.com
22  * extras: mirrors.aliyun.com
23  * updates: mirrors.aliyun.com
24 沒有可用軟件包 nginx。
25 錯誤:無須任何處理
復制代碼

   原因是nginx位於第三方的yum源里面,而不在centos官方yum源里面

  

  很多軟件包在yum里面沒有的,解決的方法,就是使用epel源,也就是安裝epel-release軟件包。EPEL (Extra Packages for Enterprise Linux)是基於Fedora的一個項目,為“紅帽系”的操作系統提供額外的軟件包,適用於RHEL、CentOS等系統。可以在下面的網址上找到對應的系統版本,架構的軟件包

  

  解決辦法,安裝epel

sudo yum install epel-release

  更新(更新時間稍微長一些,耐心等待)

yum update

  重新試一下:

yum install -y nginx

  安裝成功: 

復制代碼
已安裝:
  nginx.x86_64 1:1.12.2-3.el7                                                             

作為依賴被安裝:
  nginx-all-modules.noarch 1:1.12.2-3.el7                                                 
  nginx-filesystem.noarch 1:1.12.2-3.el7                                                  
  nginx-mod-http-geoip.x86_64 1:1.12.2-3.el7                                              
  nginx-mod-http-image-filter.x86_64 1:1.12.2-3.el7                                       
  nginx-mod-http-perl.x86_64 1:1.12.2-3.el7                                               
  nginx-mod-http-xslt-filter.x86_64 1:1.12.2-3.el7                                        
  nginx-mod-mail.x86_64 1:1.12.2-3.el7                                                    
  nginx-mod-stream.x86_64 1:1.12.2-3.el7                                                  

完畢!
復制代碼


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM