yum install nginx-没有可用软件包 nginx。
  TEZNKK3IfmPf 2023年11月12日 24 0

1. 错误提示

Centos 7下安装nginx,使用yum install nginx,报错提示没有可用的软件包。具体错误提示如下:

已加载插件:fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
 * base: mirror.lzu.edu.cn
 * extras: mirror.lzu.edu.cn
 * updates: mirror.lzu.edu.cn
base                                                                                                                                 | 3.6 kB  00:00:00     
extras                                                                                                                               | 2.9 kB  00:00:00     
updates                                                                                                                              | 2.9 kB  00:00:00     
updates/7/x86_64/primary_db                                                                                                          | 3.7 MB  00:00:01     
没有可用软件包 nginx。
错误:无须任何处理

2. 排查错误

提示里说"没有可用软件包 nginx。"我们可以通过命令 yum list | grep nginx 查看关于nginx相关的所有可安装包。

[root@localhost ~]# yum list | grep nginx
pcp-pmda-nginx.x86_64                       4.3.2-12.el7               base

3. 错误定位

通过上面的查询结果可以看得出来,nginx并不在centos官方yum源列表内。

4. 解决思路

通过 yum list 可以看到很多软件包在yum里面没有的。我们可以使用epel源(EPEL : Extra Packages for Enterprise Linux是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于RHEL、CentOS和Scientific Linux.)。

5. 具体步骤

5.1 安装epel

sudo yum install epel-release

epel-release会自动配置yum的软件仓库。

5.2 更新系统

yum update

5.1 再次安装nginx

yum install -y nginx

6. 效果图

yum install nginx-没有可用软件包 nginx。

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月12日 0

暂无评论

推荐阅读
  TEZNKK3IfmPf   2024年05月31日   28   0   0 nginxpasswd
  TEZNKK3IfmPf   2024年05月31日   52   0   0 linux服务器
  TEZNKK3IfmPf   2024年05月31日   31   0   0 linux服务器centos
  TEZNKK3IfmPf   2024年05月31日   34   0   0 nginxpasswd
  TEZNKK3IfmPf   2024年05月31日   29   0   0 linuxbind
  TEZNKK3IfmPf   2024年05月31日   40   0   0 linuxshell
TEZNKK3IfmPf