Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No package httpd available using yum on CentOs 7

Tags:

apache

centos

yum

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

like image 490
JIANGCHAO JHU Avatar asked Nov 02 '25 03:11

JIANGCHAO JHU


2 Answers

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
like image 144
Elvis Plesky Avatar answered Nov 04 '25 20:11

Elvis Plesky


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

like image 38
Chris Avatar answered Nov 04 '25 18:11

Chris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!