0

On a CentOS 7 server, I am encountering an error when trying to re-install httpd. How can I resolve this error and get httpd up and running again?

Here is the first error that resulted when I tried to install httpd:

[root@server-ip-address conf]# yum install httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.chkhosting.com
 * epel: mirror.nexcess.net
 * extras: ftpmirror.your.org
 * updates: mirror.team-cymru.org
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-18.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-18.el7.centos for package: httpd-2.4.6-18.el7.centos.x86_64
--> Finished Dependency Resolution
Error: Package: httpd-2.4.6-18.el7.centos.x86_64 (updates)
       Requires: httpd-tools = 2.4.6-18.el7.centos
       Installed: 1:httpd-tools-2.4.6-18.el7.centos.vm.1.x86_64 (@virtualmin)
           httpd-tools = 1:2.4.6-18.el7.centos.vm.1
       Available: httpd-tools-2.4.6-17.el7.centos.1.x86_64 (base)
           httpd-tools = 2.4.6-17.el7.centos.1
       Available: httpd-tools-2.4.6-18.el7.centos.x86_64 (updates)
           httpd-tools = 2.4.6-18.el7.centos
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

So I followed the suggestion and tried adding --skip-broken as follows:

[root@server-ip-address conf]# yum install httpd --skip-broken
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.chkhosting.com
 * epel: mirror.nexcess.net
 * extras: ftpmirror.your.org
 * updates: centos.mbni.med.umich.edu
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-18.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-18.el7.centos for package: httpd-2.4.6-18.el7.centos.x86_64
Packages skipped because of dependency problems:
    httpd-2.4.6-18.el7.centos.x86_64 from updates

I then tried to start the service and got the following error:

[root@server-ip-address conf]# systemctl start httpd.service
Failed to issue method call: Unit httpd.service failed to load: No such file or directory.
1

You have a conflicting version of httpd-tools, apparently from a source other than the official CentOS repositories. Remove it first:

 # rpm -e httpd-tools

If it gives you any static about it, add --force and/or --nodeps until it obeys.

When you then install httpd, it should also install a fresh copy of httpd-tools.

1

The main reason a service is masked is to prevent accidental starting or enabling of the service.

For example firewalld can be masked with systemctl mask firewalld

When starting the firewalld service, you may get the error message

Failed to issue method call: Unit firewalld.service is masked.

To resolve this, unmask the firewall with systemctl unmask firewalld.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.