Ubuntu18.04下出现sysv-rc-conf: command not found问题,命令找不到
报错部分
root@VM-0-17-ubuntu:/lib/systemd/system# sysv-rc-conf --list | grep off
sysv-rc-conf: command not found
解决方法
1、先update一下
root@VM-0-17-ubuntu:/lib/systemd/system# sudo apt-get update
2、试着直接安装sysv-rc-conf
root@VM-0-17-ubuntu:/lib/systemd/system# sudo apt-get install sysv-rc-conf
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package sysv-rc-conf
如果和我这里一样显示无法定位到sysv-rc-conf包的话
我们去资源列表中加一句
//先用vim编辑器打开sources.list
root@VM-0-17-ubuntu:/lib/systemd/system# sudo vi /etc/apt/sources.list
//打开后在最后添加这个源
deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
现在重复1、update更新一下
root@VM-0-17-ubuntu:/lib/systemd/system# sudo apt-get update
再重复2、安装sysv-rc-conf
root@VM-0-17-ubuntu:/lib/systemd/system# sudo apt-get install sysv-rc-conf
此时应该会提示
Do you want to continue? [Y/n] y
输入y或者Y就可了
我们可以用sysv-rc-conf查看mysql是否开启服务
sysv-rc-conf --list | grep mysql
返回
mysql 2:on 3:on 4:on 5:on
说明mysql服务都在工作中