我在 Ubuntu 12.04 LTS 上安装 bind9 时遇到问题。我已经安装了 Plesk 11 服务器,但 DNS 服务未运行。
root@cp11:~# apt-get install bind
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package bind is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
bind9 dnsutils dnsutils:i386 bind9:i386 manpages
E: Package 'bind' has no installation candidate
root@cp11:~#
root@cp11:~# /etc/init.d/bind9 start
* Starting domain name service... bind9 [fail]
root@cp11:~# /etc/init.d/bind9 restart
* Stopping domain name service... bind9 [ OK ]
* Starting domain name service... bind9 [fail]
当我尝试检查日志文件时:
root@cp11:~# tail -f /var/log/messages
tail: cannot open `/var/log/messages' for reading: No such file or directory
我检查了 /etc,发现有一个 bind 目录
root@cp11:/etc/bind# ls
bind.keys db.127 db.empty db.root named.conf.default-zones named.conf.options rndc.key
db.0 db.255 db.local named.conf named.conf.local rndc.conf zones.rfc1918
当我尝试卸载 bind9 时,它也会删除 Plesk 控制面板。
因此我更新并升级了软件包,但看到绑定错误:
root@cp11:~# apt-get upgrade
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-23-generic
Processing triggers for resolvconf ...
Processing triggers for python-support ...
Errors were encountered while processing:
bind9
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
软件包名称是 bind9 而不是 bind。因此,安装命令应为:
$ sudo apt-get install bind9
使用以下命令确保已安装 bind9,然后尝试启动它并检查日志中是否存在相关错误消息:
$ sudo dpkg -l | grep bind9
对于系统日志,Ubuntu 12.04 中没有/var/log/messages
文件。但是,您可以在 中找到相同的信息/var/log/syslog
。
答案2
我遇到了一个问题,Apparmor 在 Ubuntu 中导致了这个问题。因此请尝试 #/etc/init.d/apparmor 拆卸,然后重试