Home >Operation and Maintenance >CentOS >What should I do if centos cannot find the service command?

What should I do if centos cannot find the service command?

WBOY
WBOYOriginal
2022-06-22 16:32:364613browse

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.

What should I do if centos cannot find the service command?

The operating environment of this article: centos 7 system, Dell G3 computer.

What should I do if centos cannot find the service command?

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

What should I do if centos cannot find the service command?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn