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
Release: 2022-06-22 16:32:36
Original
4624 people have browsed it

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
Copy after login

error will occur.

The solution steps are as follows:

1. Enter:

# yum list | grep initscripts
Copy after login

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
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template