bash 找不到 Debian update-rc.d 命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20959534/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Debian update-rc.d command not found
提问by fifamaniac04
I have seen some of the posts online where it says to navigate to the dir /usr/sbin/
and look for the file update-rc.d
but I'm still running into the error that the bash: command not found
.
我在网上看过一些帖子,上面说导航到目录/usr/sbin/
并查找文件,update-rc.d
但我仍然遇到错误,bash: command not found
.
I'm trying to run:
update-rc.d -f gdm3 defaults
我正在尝试运行:
update-rc.d -f gdm3 defaults
I've also tried: /usr/sbin/update-rc.d -f gdm3 defaults
我也试过: /usr/sbin/update-rc.d -f gdm3 defaults
but that is still resulting in the same error.
但这仍然导致相同的错误。
please advise... thanks
请指教……谢谢
回答by Lee Duhem
/usr/sbin/update-rc.d
belongs to Debian package sysv-rc
or file-rc
, you should install one of them.
/usr/sbin/update-rc.d
属于 Debian 软件包sysv-rc
或file-rc
,您应该安装其中之一。
If you only know a file name and want to find out which package it belongs to, you can use the following command:
如果你只知道一个文件名,想知道它属于哪个包,可以使用以下命令:
apt-file search file-name
To use it, you need to install package apt-file
and update the local cache as instructed after you finished the installation.
要使用它,您需要在安装apt-file
完成后按照说明安装包并更新本地缓存。
Or you can search it online: Search the contents of packages.
或者你可以在网上搜索一下:搜索包的内容。
回答by rubo77
update-rc.d
can only be called by root, so try
update-rc.d
只能被root调用,所以试试
sudo update-rc.d ...
or if you don't have sudo installed:
或者如果您没有安装 sudo:
su root
update-rc.d ....
回答by Lucky Larry
I also had a problem with
我也有问题
$ sudo update–rc.d apache2 defaults
the hyphen between update and rc.d was picked up by ctrl-c from a web page. The same command
update 和 rc.d 之间的连字符是由 ctrl-c 从网页中提取的。同样的命令
$ sudo update-rc.d apache2 defaults
when typed in directly ran OK. I think the hyphen is a printer's special character, not a keyboard-typed hyphen.
输入时直接运行OK。我认为连字符是打印机的特殊字符,而不是键盘输入的连字符。