当我尝试:
yum install 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
答案 0 :(得分:0)
httpd
软件包可以从默认的CentOS存储库“基本”和“更新”(对于较新的版本)中安装。
# 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