72人参与 • 2026-10-09 • MsSqlserver
ubuntu使用chkconfig命令时报错:
chkconfig: command not found
后来发现chkconfig是redhat下的程序,而在ubuntu需用用sysv-rc-conf来代替。
在ubuntu下,用apt-get安装sysv-rc-conf:
命令如下:
sudo apt-get install sysv-rc-conf
e: unable to locate package sysv-rc-conf
无法定位软件包 sysv-rc-conf,需要在sources.list 文件末尾添加镜像源:
sudo vim /etc/apt/sources.list # 在sources.list 文件末尾添加镜像源 deb http://archive.ubuntu.com/ubuntu/ trusty main universe restricted multiverse
sudo apt-get update
w: gpg error: http://archive.ubuntu.com/ubuntu trusty release: the following signatures couldn't be verified because the public key is not available: no_pubkey 40976eaf437d05b5 no_pubkey 3b4fe6acc0b21f32
e: the repository 'http://archive.ubuntu.com/ubuntu trusty release' is not signed.
n: updating from such a repository can't be done securely, and is therefore disabled by default.
n: see apt-secure(8) manpage for repository creation and user configuration details.
这个错误表示由于没有公钥,无法验证下列签名: no_pubkey 40976eaf437d05b5 no_pubkey 3b4fe6acc0b21f32
下面来添加密钥:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976eaf437d05b5 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3b4fe6acc0b21f32
sudo apt-get update
sudo apt-get install sysv-rc-conf
sub-process /usr/bin/dpkg returned an error code (1)
cd /var/lib/dpkg/ sudo mv info/ info_bak # 现将info文件夹更名 sudo mkdir info # 再新建一个新的info文件夹 sudo apt-get update # 更新 sudo apt-get -f install # 修复 sudo mv info/* info_bak/ # 执行完上一步操作后会在新的info文件夹下生成一些文件,现将这些文件全部移到info_bak文件夹下 sudo rm -rf info # 把自己新建的info文件夹删掉 sudo mv info_bak info # 把以前的info文件夹重新改回名
复制sysv-rc-conf文件为chkconfig
sudo cp /usr/sbin/sysv-rc-conf /usr/sbin/chkconfig

以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
您想发表意见!!点此发布评论
版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。
发表评论