簡單地說, 把 /var/lib/dpkg/status 這個檔備份後, 再編輯此檔。
尋找造成錯誤的套件, 以此例來說, 就是 `nmap' 套件
Package: nmap
Status: install ok installed
Priority: extra
Section: net
Installed-Size: 6232
... (以下略)
把這個和 nmap 段落相關的刪除, 再重新執行 sudo apt-get upgrade 即可。
==原本的錯誤==
sudo apt-get upgrade[sudo] password for yinung:
正在讀取套件清單... 完成
正在重建相依關係
正在讀取狀態資料... 完成
下列套件將會被升級:
xxxxx xxxx-doc
升級 2 個,新安裝 0 個,移除 0 個,有 0 個未被升級。
需要下載 0B/32.0MB 的套件檔。
此操作完成之後,會多佔用 17.3MB 的磁碟空間。
是否繼續進行 [Y/n]?Y
(正在讀取資料庫 ...
dpkg: warning: files list file for package `antiword' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `libiw29' missing, assuming package has no files currently installed.
dpkg: warning: files list file for package `ttf-cwtex-center-cwkai' missing, assuming package has no files currently installed.
(正在讀取資料庫 ... 95%dpkg:無可挽回的致命錯誤,中止操作:
buffer_read(fd) 失敗:套件 `nmap' 的檔案列表檔: 輸入/輸出錯誤
E: Sub-process /usr/bin/dpkg returned an error code (2)
===解決方法原文===
1. Go into the /var/lib/dpkg directory2. Make a backup of the "status" file
3. Edit the "status" file
4. Search the package that gave the error
5. Just delete the lines from this package (but let all other lines that concern other packages even if they contains the broken package in their "Replaces" or "Depends" fields)
沒有留言:
張貼留言