bash service command not found

bash: service: command not found
centos系统中,如果/sbin目录下没有service这个命令,就会出现
-bash: service: command not found
的错误。
解决步骤如下:
1、输入:
yum list | grep initscripts
会出现
initscripts.x86_64 9.49.30-1.el7_2.3 updates
2、上面给出了可安装软件的yum源版本。
上面是目前系统已安装的initscripts情况,因为没有了service文件,显然已经出现了错误,然后执行
yum install initscripts
等待安装完毕!

posted @ 2022-07-12 14:17  leiuk  阅读(146)  评论(0编辑  收藏  举报