无法升级 Ubuntu

无法升级 Ubuntu

恢复 /var/lib/dpkg/status 后,我无法升级我的 ubuntu 系统。

日志在这里:

Preconfiguring packages ...
Setting up debconf (1.5.58ubuntu2) ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing package debconf (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 debconf
E: Sub-process /usr/bin/dpkg returned an error code (1)

您能否协助我修复这些问题?我尝试了在谷歌上能找到的所有方法,但结果都一样。提前感谢您的帮助。

所以之后

dpkg -l | egrep -v '^ii|rc'

我有:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
+++-=======================================-==========================================-============-===============================================================================
rF  debconf                                 1.5.58ubuntu2                              all          Debian configuration management system
iU  debconf-i18n                            1.5.58ubuntu2                              all          full internationalization support for debconf

如果我尝试:

sudo dpkg --configure -a

我有 :

dpkg: dependency problems prevent configuration of debconf-i18n:
 debconf-i18n depends on debconf (= 1.5.58ubuntu2); however:
  Package debconf is not configured yet.

dpkg: error processing package debconf-i18n (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 debconf-i18n

强制安装(方法 2):

dpkg: error processing package debconf-i18n (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 debconf
 debconf-i18n
E: Sub-process /usr/bin/dpkg returned an error code (1)

方法 3

0 upgraded, 0 newly installed, 0 to remove and 220 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up debconf (1.5.58ubuntu2) ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing package debconf (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of debconf-i18n:
 debconf-i18n depends on debconf (= 1.5.58ubuntu2); however:
  Package debconf is not configured yet.

dpkg: error processing package debconf-i18n (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                          Errors were encountered while processing:
 debconf
 debconf-i18n

答案1

wget -c http://mirrors.kernel.org/ubuntu/pool/main/d/debconf/debconf_1.5.58ubuntu2_all.deb

尝试直接使用

sudo dpkg -i debconf_1.5.58ubuntu2_all.deb

如果有效的话

sudo dpkg --configure -a && sudo apt -f install

答案2

尝试重新配置 dpkg(方法 1)

sudo dpkg --configure -a

使用强制安装(方法 2)

sudo apt-get install -f

尝试删除有问题的包(方法 3)

sudo apt remove

请告诉我上述方法是否有效!

相关内容