2014-12-01 98 views
8

我已經安裝了Ubuntu 14.04 Server(64位)。我無法在純Ubuntu上安裝udev 14.04

使用時:

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的更新之後就OK,但...

當我試圖「須藤apt-get upgrade':

Fetched 534 kB in 4s (112 kB/s)    
Reading package lists... Done 
[email protected]****:/# 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) 

我在網上找不到任何解決方案,嘗試了很多方法,但沒有任何工作......

+0

你有沒有真的試圖「須藤dpkg的--configure -a」? – diogovk 2014-12-10 11:38:37

+0

是的,沒有結果。無論如何,我已經找到了解決方案... – kaczorro 2014-12-10 23:04:23

回答

23

原因可能是在OVH服務器上的所有Ubuntu 14.04安裝上發生該問題。我已經聯繫過技術支持,他們沒有任何可能有助於「幫助自己」的答案。

收到此錯誤後:

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

+0

可以確認它的工作原理。似乎它與使用不支持hotplug的舊版Linux內核的VPS主機有關。所以只有在OVH更新主機時才能解決。 – fmcato 2014-12-17 22:36:07

+0

謝謝,我一直有這個問題一個月,現在它解決了。 – 2015-03-24 10:07:31

5

對於那些在我之後誰到這裏,我不得不編輯/usr/sbin/invoke-rc.d第一的意見後,添加退出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 

然後從調用-rc.d中取出退出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