I had this service: command not found problem after I reinstalled iptables with yum.
The right solution seems to be indeed yum install initscripts.x86_64
But while I tried to reinstall with yum reinstall command I kept getting this error:
Package(s) initscripts.x86_64 available, but not installed.
Error: Nothing to do
Next day I tried with install instead of reinstall and it worked OK, but I didn't do more tests:
yum install initscripts.x86_64
Previous error(s) might have been temporary errors in remote repositories but I am not 100% sure.
This happen on an older Centos 7.x machine, if you see repository errors while installing with yum:
- edit the files in
/etc/yum.repos.d (mostly CentOS-Base.repo and CentOS-fasttrack.repo) and replace instances of http://mirror.centos.org to https://vault.centos.org (note https).
- comment line
mirrorlist= and uncomment line baseurl=, that should force it get from main source and ignore mirrors that might be out of date. Previously it was mirrors enabled and baseurl disabled.
Hopefully I got the details right.