service命令是要用ROOT用户来执行的,
而出错的用户是用su root切换到ROOT用户下,这个命令没有也不会把环境带过去!

用如下命令就不会出错了:
su - root

注意:su 后面是一个空格,横线后面也是一个空格,千万不能省略.
很简单,但是很实用!

备注:随笔中内容来源于网上资料整理,仅供参考。

bash: service: command not found 错误的解决方法的更多相关文章

  1. 一秒解决CentOS下service 功能 不能使用 bash: service: command not found

    首先检查自己是否 使用的是root用户 如果是并且还不能用-----执行以下操作 在centos系统中,如果/sbin目录下没有service这个命令,就会出现 bash: service: comm ...

  2. 解决CentOS下service 功能 不能使用 bash: service: command not found

    首先检查自己是否 使用的是root用户 在centos系统中,如果/sbin目录下没有service这个命令,就会出现 bash: service: command not found 解决步骤如下: ...

  3. linux下报错bash: service: command not found

    在linux下操作的时候经常会遇到,bash: service: command not found这个错误,以前在网上找了,照着弄了,也没细看原因,今天又碰到这个问题,就顺便研究一下. 1.通常这种 ...

  4. centos没有service命令的恢复方法(-bash: service: command not found)

    转载自:https://blog.csdn.net/u014175572/article/details/53375049?utm_source=itdadao&utm_medium=refe ...

  5. 【转】mac终端安装node时候,显示“-bash: brew: command not found”,怎么解决?

    原文网址:https://segmentfault.com/q/1010000004221389/a-1020000004221408 mac终端安装node时候,显示“-bash: brew: co ...

  6. 安装tomcat出现failed to install tomcat8 service错误及解决方法

    failed to install tomcat8 service 如下图所示:     一.安装tomcat出现failed to install tomcat6 service错误及解决方法(转载 ...

  7. 安装tomcat出现failed to install tomcat6 service错误及解决方法(转载)

    安装安装版tomcat会出现failed to install tomcat6 service ,check your setting and permissio的概率是非常低的,但是最近楼主就老出现 ...

  8. CentOS 安装hping3工具及安装遇到的错误及解决方法

    hping是用于生成和解析TCPIP协议数据包的开源工具.创作者是Salvatore Sanfilippo.目前最新版是hping3,支持使用tcl脚本自动化地调用其API.hping是安全审计.防火 ...

  9. Linux系统Vsftp 传文件出现 553 Could Not Create File错误的解决方法

    解决方法: 登录出现了这个错误提示:553 Could not create file SELinux设置如下 查看SELinux设置 [root@localhost ~]# getsebool -a ...

随机推荐

  1. 【HDOJ6600】Just Skip The Problem(签到)

    题意:询问n!模1e6+7的结果 n<=1e9 思路: #include<bits/stdc++.h> using namespace std; typedef long long ...

  2. 汇编 “error A2031”

    assume cs:code code segment main: mov ax,0020h mov ds,ax ;指定段地址0200h mov dx,0h mov cx,003fh s: mov [ ...

  3. [CSP-S模拟测试]:联盟(搜索+树的直径)

    题目描述 $G$国周边的$n$个小国家构成一个联盟以抵御$G$国入侵,为互相支援,他们建立了$n−1$条双向通路,使得任意两个国家可以经过通路相互到达.当一个国家受到攻击时,所有其它国家都会沿着最短路 ...

  4. spring-cloud config配置中心

    这里那些概念不说,主要是记录下spring cloud config配置中心的服务端和客户端的一个demo. 服务端即提供统一配置文件 客户端即从服务端读取配置 1.新建一个spring boot项目 ...

  5. 【VisualStdio】在VS2015中显示上下文菜单中“创建单元测试”菜单

    ---恢复内容开始--- VS2012以后创建单元测试的选项被默认隐藏了,创建单元测试变得无比低效率.看msdn的说法好像是想推荐使用Intell Test来替代单元测试的用途,但是还没摸清楚也不敢瞎 ...

  6. 关于tomcat中的三个端口的作用及其相关细节

    [一]端口内容 tomcat的端口号相关信息: Tomcat admin port——管理端口,允许你远程配置tomcat HTTP——正常的http协议 AJP——Apache JServ Prot ...

  7. 转载:LESS基本用法

    转载出处:https://blog.csdn.net/qq_38209578/article/details/80566860 转载出处:https://blog.csdn.net/weixin_44 ...

  8. 安装vue开发环境→安装淘宝镜像的时候报错

    问题: npm WARN deprecated socks@1.1.10: If using 2.x branch, please upgrade to at least 2.1.6 to avoid ...

  9. pycharm格式化python代码快捷键Ctrl+Alt+L失效

    突然发现按Ctr+Alt+L格式化python失效了,下午时候还好好的.看网上得说法是因为开着的其他软件里用了全局快捷键Ctr+Alt+L,我的是因为被网易云音乐占用了,所以在网易云音乐里把这个快捷键 ...

  10. 使用autoconf和automake生成Makefile

    使用环境: 我的是Ubuntu 16.04,需要用到autoconf和automake,没有的话自行安装. 以helloworld为例: 1.首先新建一个文件夹然后进去没的说:然后自然得先写出那个著名 ...