無法寫入位元組:管道損壞 - 尋找已刪除包的日誌

無法寫入位元組:管道損壞 - 尋找已刪除包的日誌

我有一個 12.04 和 windows 7 的雙啟動系統。 Ubuntu 昨天工作正常,但今天早上啟動時我遇到了問題。搜尋了論壇,恢復失敗。我試過 :

sudo gedit /var/log/apt/history.log

若要查看已刪除軟體包的日誌,請取得以下內容:

** (gedit:976): WARNING **: Command line 'dbus-launch --autolaunch=2d7d18532e9953bc8a2b852e00000007 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n
Cannot open display:
Run 'gedit --help' to see a full list of available command line options.

有人有任何修復建議嗎?如果您需要任何其他信息,請告訴我。

問題解決了。 1. 進入復原模式/ 2. 在復原模式下啟用網路/ 3. 在復原模式下選擇Drop to Shell / 4. 在shell 中sudo apt-get install xserver-xorg-core xserver-xorg / 5. 在shell 中dpkg-reconfigure xserver-xorg / 6.退出bash並返回恢復選單,選擇正常啟動。感謝大家的建議。中號

答案1

awk '/^Remove/' /var/log/apt/history.log

這將向您顯示最近刪除的軟體包,日誌中最舊的軟體包將排在第一位。歷史記錄會隨著時間的推移而存檔,因此您可能會發現需要檢查較舊的文件(我有 12 個編號的存檔)才能檢查第一個:

zcat /var/log/apt/history.log.1.gz | awk '/^Remove/'

或者你可以一次完成所有這些:

zgrep -E --color '^Remove' /var/log/apt/history*

我不確定這是否有用,因為它可能會向您顯示太多資訊。

相關內容