Home > Article > Operation and Maintenance > What should I do if centos cannot find the service command?
The solution to the problem that centos cannot find the service command: 1. Use the "yum list | grep initscripts" command to obtain the yum source version that can install initscripts; 2. Use the "yum install initscripts -y" command to install initscripts is enough.
The operating environment of this article: centos 7 system, Dell G3 computer.
In the centos system, if there is no service command in the /sbin directory, an
-bash: service: command not found
error will occur.
The solution steps are as follows:
1. Enter:
# yum list | grep initscripts
will appear 2. The yum source version of the installable software is given above.
The above is the initscripts currently installed in the system. Because there is no service file, an error has obviously occurred. Then execute
# yum install initscripts
There is no service in docker centos6 and it is not convenient to install. After a while, the command is as follows:
yum install initscripts -y
After installation, there will be service
Recommended tutorial: "centos tutorial"
The above is the detailed content of What should I do if centos cannot find the service command?. For more information, please follow other related articles on the PHP Chinese website!