skip to Main Content

When I try:

yum install httpd

I get the error:

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

2

Answers


  1. httpd package can be installed from default CentOS repositories, ‘base’ and ‘updates’ (for a newer version).

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

    Make sure that you have repository file /etc/yum.repos.d/CentOS-Base.repo or create it manually, with, at very least, the following content:

    [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
    

    Then do:

    # yum clean all && yum update -y && yum install httpd -y
    
    Login or Signup to reply.
  2. We ran into this issue as well and found the following in yum.conf:

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

    Removing httpd from there let us install it

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search