dpkg:处理包时出错,无法安装任何包

dpkg:处理包时出错,无法安装任何包

我是 Ubuntu 新手。我正在使用 14.04。

每当我尝试安装任何软件时,dpkg 都会出错。浏览一段时间后,我得到了一些命令来尝试。没有什么真正有用的。第一个是运行,sudo dpkg--configure-a

但当我运行它时,我得到的就是这些,

dpkg: error processing package software-properties-common (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of software-properties-gtk:
 software-properties-gtk depends on software-properties-common; however:
  Package software-properties-common is not configured yet.

dpkg: error processing package software-properties-gtk (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 software-properties-common
 software-properties-gtk

当我尝试下一个命令时,sudo apt-get install -f 我得到了这个......,

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.
2 not fully installed or removed.
Need to get 0 B/9,370 B of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: error processing package software-properties-common (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
dpkg: dependency problems prevent configuration of software-properties-gtk:
 software-properties-gtk depends on software-properties-common; however:
  Package software-properties-common is not configured yet.
No apport report written because the error message indicates its a followup error from a previous failure.

dpkg: error processing package software-properties-gtk (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 software-properties-common
 software-properties-gtk
E: Sub-process /usr/bin/dpkg returned an error code (1)

仅供参考,没有安装 synaptic

非常感谢您的帮助。谢谢。

答案1

因为评论中的想法可行,所以答案如下:

  1. 删除最终损坏的 DEB 包

    sudo apt-get clean
    
  2. 强制重新安装损坏的软件包

    sudo apt-get install --reinstall software-properties-common
    

    因为这只是一个包的重新安装,所以其他包不会恢复。

相关内容