Ubuntu安装chkconfig命名

Ubuntu 默认是没有chkconfig命令的,需要手动安装。

使用终端安装命令:
sudo apt-get install sysv-rc-conf
如果出现问题:找不到该软件包,在sources.list文件中添加阿里的镜像源即可
cd /etc/apt
先备份 cp sources.list sources.list.old
vim sources.list
把下面阿里的镜像源添加进去

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

更新源:sudo apt-get update
重新安装:sudo apt-get install sysv-rc-conf

更名为chkconfig
sudo cp /usr/sbin/sysv-rc-conf /usr/sbin/chkconfig
赋予权限:chmod 755 chkconfig
验证是否成功:sudo chkconfig

使用chkconfig来查看某个服务的运行级别和状态:
chkconfig --list 服务名

猜你喜欢

转载自blog.csdn.net/qq_41030039/article/details/89330981