centos找不到service命令的解决方法:1、利用“yum list | grep initscripts”命令,获取可安装initscripts的yum源版本;2、利用“yum install initscripts -y”命令,安装initscripts即可。
本文操作环境:centos 7系统、Dell G3电脑。
centos系统中,如果/sbin目录下没有service这个命令,就会出现
-bash: service: command not found
的错误。
解决步骤如下:
1、输入:
# yum list | grep initscripts
会出现
2、上面给出了可安装软件的yum源版本。
上面是目前系统已安装的initscripts情况,因为没有了service文件,显然已经出现了错误,然后执行
# yum install initscripts
在 docker centos6 中 没有service 不太方便安装一下,命令如下:
yum install initscripts -y
安装后就有 service 了
推荐教程:《centos教程》
以上就是centos找不到service命令怎么办的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号