debconf-i18n 依賴 debconf (= 1.5.58ubuntu2);但是:系統上的 debconf 版本是 1.5.58ubuntu1

debconf-i18n 依賴 debconf (= 1.5.58ubuntu2);但是:系統上的 debconf 版本是 1.5.58ubuntu1

當我嘗試在 Ubuntu 16.04 中安裝 git 時,

 sudo apt-get install git
debconf-i18n : Depends: debconf (= 1.5.58ubuntu2) but 1.5.58ubuntu1 is to be installed
 git : Depends: liberror-perl but it is not going to be installed
       Depends: git-man (> 1:2.7.4) but it is not going to be installed
       Depends: git-man (< 1:2.7.4-.) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

為了解決這個問題,

sudo apt-get install --reinstall debconf=1.5.58ubuntu2

但我收到以下錯誤。

/var/lib/dpkg/info/debconf.prerm: 15: /var/lib/dpkg/info/debconf.prerm: pyclean: not found
dpkg: warning: subprocess old pre-removal script returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 15: /var/lib/dpkg/tmp.ci/prerm: pyclean: not found
dpkg: error processing archive /var/cache/apt/archives/debconf_1.5.58ubuntu2_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/debconf.postinst: 75: /var/lib/dpkg/info/debconf.postinst: pycompile: not found
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 /var/cache/apt/archives/debconf_1.5.58ubuntu2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

手動編輯有問題的文件/var/lib/dpkg/info/debconf.prerm對我有用

從這個答案https://askubuntu.com/a/979022/1025261

相關內容