E: Sub-process /usr/bin/dpkg returned an error code (1) 解決方案

軟件版本:
  操作系統:ubuntu10.04
  內核版本:Linux version 2.6.32-41-generic

目錄:
  1. 錯誤
  2. 解決方法
    1) 方案一
    2) 方案二
    3) 方案三
  3. 參考資料

1. 錯誤

  在使用 apt-get 安裝工具時,無論安裝什麼軟件都會遇到這樣子的錯誤:

複製代碼
dpkg: warning: files list file for package `tex-common' missing, assuming package has no files currently installed.
(Reading database ... 150177 files and directories currently installed.)
Preparing to replace tex-common 2.06ubuntu0.1 (using .../tex-common_2.06ubuntu0.1_all.deb) ...
Unpacking replacement tex-common ...
Processing triggers for doc-base ...
Processing 2 changed doc-base file(s)...
Registering documents with scrollkeeper...
Processing triggers for man-db ...
Setting up tex-common (2.06ubuntu0.1) ...
Running mktexlsr. This may take some time... done.
No packages found matching texlive-base.
dpkg: error processing tex-common (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 tex-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
複製代碼

 

2. 解決方案

1) 方案一

cd /var/lib/dpkg
sudo mv info info.bak
sudo mkdir info
重新安裝,在此爲:
sudo apt-get --reinstall tex-common

  這個方案來源於[1]。這種方法可能會造成安裝軟件時出現一大片 warning 。

2) 方案二

cd /var/lib/dpkg/info
sudo mkdir tex-common
sudo mv tex-common.* tex-common

  這個方法是根據方案一想出來的,也可以解決這個錯誤。暫時不知道會不會造成其他錯誤。

3) 方案三

sudo apt-get purge tex-common
sudo apt-get install tex-common

  這個方案其實就是將 tex-common 清除後,重裝。來源於[2]

3. 參考資料

[1]. http://forum.ubuntu.org.cn/viewtopic.php?f=86&t=90547 
[2]. http://askubuntu.com/questions/25693/dpkg-behaving-strangely

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章