!
也想出现在这里? 联系我们
广告位
当前位置:首页>教程分享>服务器教程>Centos下yum安装nginx本地仓库无nginx源解决方案

Centos下yum安装nginx本地仓库无nginx源解决方案

一、在CentOS下使用yum install -y nginx  命令时,出现如下错误:

[root@hadoop100 /]#yum install -y nginx

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirrors.huaweicloud.com

 * extras: mirrors.huaweicloud.com

 * updates: mirrors.huaweicloud.com

没有可用软件包 nginx。

错误:无须任何处理

 

二、问题原因

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

三、解决方法

查看系统是6还是7

[root@hadoop100 /]# cat /etc/redhat-releaseCentos下yum安装nginx本地仓库无nginx源解决方案

在使用yum install命令时,可以直接指定安装包的https下载路径,如下: 

RHEL/CentOS 6:

     # yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

RHEL/CentOS 7:

     # yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

另外说明,如果在RHEL上安装,还需要安装与启动EPEL相关的组件;

    # subscription-manager repos --enable \"rhel-*-optional-rpms\" --enable \"rhel-*-extras-rpms\"

执行下面的命令

[root@hadoop100 /] yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

再次执行安装命令即可

方案二:直接下载一个epel源替代系统的软件源:

配置yum源、epel源为国内镜像

cd /etc/yum.repos.d

获取阿里centos7的base-repo

wget https://mirrors.aliyun.com/repo/epel-7.repo

给TA打赏
共{{data.count}}人
人已打赏
服务器教程

云服务器CentOS中如何重启网络服务?

2021-4-17 17:37:49

服务器教程

IOPS、带宽(band width)、吞吐量 (throughput)

2021-4-17 17:37:51

声明 本站上的部份代码及教程来源于互联网,仅供网友学习交流,若您喜欢本文可附上原文链接随意转载。无意侵害您的权益,请发送邮件至 [email protected] 或点击右侧 私信:吉吉国王 反馈,我们将尽快处理。
0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索
OneEase