无法在纯净的Ubuntu 14.04上安装udev

10

我已经安装了纯净版的Ubuntu 14.04服务器(64位)。

当使用时:

sudo apt-get update

打印此错误:

....
Hit http://security.ubuntu.com trusty-security/universe Translation-en
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem. 

删除 tmp.i 后,执行 /var/lib/dpkg/updates# sudo rm tmp.i 命令,apt-get update 命令可以正常运行,但是...

当我尝试使用 'sudo apt-get upgrade' 命令时:

Fetched 534 kB in 4s (112 kB/s)              
Reading package lists... Done
root@vps****:/# sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up udev (204-5ubuntu20.9) ...
 * udev requires hotplug support, not started
   ...fail!
invoke-rc.d: initscript udev, action "restart" failed.
dpkg: error processing package udev (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 udev
E: Sub-process /usr/bin/dpkg returned an error code (1)

到目前为止,我在网上找不到任何解决方案,尝试了许多方法但是都没起作用...


你尝试过实际运行 "sudo dpkg --configure -a" 吗? - diogovk
是的,没有结果。无论如何,我已经找到了解决方案... - kaczorro
4个回答

24

问题可能是因为所有Ubuntu 14.04安装在OVH服务器上都会出现。我联系了技术支持,他们除了“自己解决”之外没有任何可以帮助的答案。

在遇到这个错误后:

nano /etc/init.d/udev

在### END INIT INFO后添加:

exit 0         

保存并退出。

dpkg --configure -a         
apt-get upgrade         

再次编辑文件,删除exit 0,保存并退出。然后安装后续的软件包会正常工作,系统在重新启动后似乎没有出现过那个可怕的错误信息。

此线程提供了临时解决方案:http://forum.ovh.co.uk/showthread.php?8480-udev-requires-hotplug-support-not-started/page2&s=2144010031f992268c5690726da09284


可以确认它有效。似乎与VPS主机使用的旧Linux内核有关,该内核不支持热插拔。因此,只有在OVH更新其主机时才能解决这个问题。 - fmcato
谢谢,我遇到这个问题已经一个月了,现在终于解决了。 - Jacer Omri

5

对于那些在我之后来到这里的人,我必须编辑/usr/sbin/invoke-rc.d,在第一条注释后添加exit 0以让udev进行配置。

nano -w /usr/sbin/invoke-rc.d

...
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
exit 0

然后运行:

dpkg --configure -a

然后从“invoke-rc.d”中删除“exit 0”。

0

不必两次编辑/etc/init.d/udev,只需在### END INIT INFO后面添加一个新行:

dpkg --configure -a || exit 0

这样,如果dpkg --configure失败,它将退出,否则它将像往常一样继续执行。

或者,如果编辑文件不是你的强项,这个方法也可以解决问题:

[ ! "$(grep -A1 '### END INIT INFO' /etc/init.d/udev | grep 'dpkg --configure -a || exit 0')" ] \
&& sudo sed -i 's/### END INIT INFO/### END INIT INFO\
dpkg --configure -a || exit 0/' /etc/init.d/udev

0

对于在OVH服务器上遇到此问题的人,以上的hack不再需要!

proxy提供的答案应该可以解决问题:

$ apt-get download udev
$ sudo dpkg -i --force-confmiss udev_*_amd64.deb
$ sudo apt-get upgrade

Worked for me. For more info go to Dimitri's comment in Ubuntu's bug tracker.

看起来这是因为OVH没有在您的系统中放置/etc/init/udev.conf。 10/10


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接