我無法安裝、更新或使用 、 等執行任何apt-get
其他aptitude
操作dpkg
。
鎖定檔案/var/lib/dpkg/lock
從啟動時起就存在。當我刪除它並運行時apt-get update
,它會列印出 dpkg 已中斷。我dpkg --configure -a
按照幫助文本中提到的方式進行了嘗試,但這遇到了 gconf2 的問題:
root@andre-ubuntu:/home/andre# dpkg --configure -a
Setting up libbonoboui2-0:amd64 (2.24.5-0ubuntu2) ...
Setting up libgnomeui-0:amd64 (2.24.5-2ubuntu3) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Setting up gconf2 (3.2.6-0ubuntu1) ...
(gconftool-2:16760):
GConf-WARNING **: Client failed to connect to the D-BUS daemon:
Did not receive a reply. Possible causes include: the remote application
did not send a reply, the message bus security policy blocked the reply,
the reply timeout expired, or the network connection was broken.
dpkg
在這一點上停止,我什至無法用 中斷它Ctrl+C。
我有以下版本的 Ubuntu:
Linux andre-ubuntu 3.8.0-19-generic #30-Ubuntu
SMP Wed May 1 16:35:23 UTC 2013
x86_64 x86_64 x86_64 GNU/Linux
您有什麼想法要做什麼嗎?
答案1
幾年前,由於 GUI 小工具正在尋找系統更新並鎖定了套件管理器,我也遇到了相同的問題。
您也許可以驗證正在執行的 GUI 應用程式(包括小部件、系統托盤),以確保沒有開啟與套件管理相關的應用程式。
答案2
如果大多數 Linux 版本中有一個軟體包沒有完全安裝,您將收到鎖定錯誤。我不記得錯誤是如何表達的。它說突觸被鎖定或類似的東西。嘗試運行它通常可以工作。適用於 Ubuntu 套件管理器,我在 debian 和 ubuntu 上使用過它,並且兩次都有效。打開終端,然後鍵入或複製並貼上以下內容:
sudo rm /var/lib/dpkg/lock
sudo rm -r /tmp/*
sudo dpkg –clear-avail && sudo apt-get update
請記住,當您鍵入超級用戶密碼時,您不會看到它。
我已經在 Debian 和 Ubuntu 上使用過它,它對我很有用。這適用於任何 Linux 套件管理器。當它們被鎖定時,我都用過它。