【问题标题】:No package httpd available using yum on CentOs 7在 CentOs 7 上使用 yum 没有可用的包 httpd
【发布时间】:2018-08-01 12:05:47
【问题描述】:

当我尝试时:

yum 安装 httpd

我得到错误:

Loaded plugins: changelog, fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.cloud.aliyuncs.com
 * extras: mirrors.cloud.aliyuncs.com
 * updates: mirrors.cloud.aliyuncs.com
No package httpd available.
Error: Nothing to do

enter image description here

【问题讨论】:

  • 您的系统中没有 httpd 的 repo。首先更新 OS db 然后尝试或下载 httpd rpm 并安装。
  • 我更新了yum,但是还是不行。
  • 从这里下载 RPM 并尝试安装.. mirror.centos.org/centos/7/os/x86_64/Packages ...仍然,您发现任何依赖问题,然后您需要创建本地 yum 存储库来安装 httpd
  • 谢谢。我正在努力。

标签: apache centos yum


【解决方案1】:

httpd 软件包可以从默认的 CentOS 存储库、'base' 和 'updates' 安装(对于较新的版本)。

# repoquery -i httpd | grep -i repo
Repository  : updates

确保您有存储库文件/etc/yum.repos.d/CentOS-Base.repo 或手动创建它,至少包含以下内容:

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
gpgcheck=0
enabled=1

[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
gpgcheck=0
enabled=1

然后做:

# yum clean all && yum update -y && yum install httpd -y

【讨论】:

  • 谢谢你。我通过更改镜像列表解决了这个问题。我的服务器是阿里云。默认情况下,我在服务器上安装了 CentOs 7.3。它的镜像列表是mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch。我添加了来自中国的其他 baseurl。但这是行不通的。之后,我用 CentOs 7.4 替换了系统。重新安装httpd并制作它。
【解决方案2】:

我们也遇到了这个问题,在 yum.conf 中发现了以下内容:

exclude=httpd nginx php mysql mairadb python-psutil python2-psutil

从那里删除 httpd 让我们安装它

【讨论】:

    猜你喜欢
    • 2018-04-21
    • 1970-01-01
    • 1970-01-01
    • 2021-05-10
    • 2019-10-10
    • 2020-04-02
    • 1970-01-01
    • 2018-03-09
    • 2020-04-27
    相关资源
    最近更新 更多