破了dpgk? 运行脚本失败/ usr / sbin / dpkg-preconfigure –apt || 真正

Ubuntu Server 14.04

apt-get install  

产生错误:

 E: Waited for /usr/sbin/dpkg-preconfigure --apt || true but it wasn't there E: Failure running script /usr/sbin/dpkg-preconfigure --apt || true 

似乎安装了dpkg,请参阅:

 $ sudo apt-get install dpkg Reading package lists... Done Building dependency tree Reading state information... Done dpkg is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 

我该如何修理这个包裹?

我试过了

 sudo apt-get install --reinstall dpkg 

但当然这个动作会产生同样的错误。

这意味着您的配置脚本存在一些问题,因为DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";}; 不存在所以你必须创建它。

尝试使用此命令创建它:

 sudo sh -c "echo 'DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";};' >> /etc/apt/apt.conf.d/70debconf" 

要分步执行:

打开/etc/apt/apt.conf.d/70debconf

  gksudo gedit /etc/apt/apt.conf.d/70debconf 

添加此行并保存:

 DPkg::Pre-Install-Pkgs {"/usr/sbin/dpkg-preconfigure --apt || true";}; 

现在再试一次