安装软件包时出现问题


12

由于出现此错误,我无法安装任何软件包:

installArchives() failed: E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: No such file or directory
dpkg: regarding .../libgcc1_1%3a4.7.2-2ubuntu1_amd64.deb containing libgcc1:amd64, pre-dependency problem:
 libgcc1 pre-depends on multiarch-support
  multiarch-support is unpacked, but has never been configured.

dpkg: error processing /var/cache/apt/archives/libgcc1_1%3a4.7.2-2ubuntu1_amd64.deb (--unpack):
 pre-dependency problem - not installing libgcc1:amd64
Errors were encountered while processing:
 /var/cache/apt/archives/libgcc1_1%3a4.7.2-2ubuntu1_amd64.deb
Error in function: 
dpkg: dependency problems prevent configuration of libc6:amd64:
 libc6:amd64 depends on libgcc1; however:
  Package libgcc1 is not installed.
 libc6:amd64 depends on tzdata; however:
  Package tzdata is not installed.

dpkg: error processing libc6:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of multiarch-support:
 multiarch-support depends on libc6 (>= 2.3.6-2); however:
  Package libc6:amd64 is not configured yet.

dpkg: error processing multiarch-support (--configure):
 dependency problems - leaving unconfigured

@EliahKagan我相信这是不同的。在您提供的链接中查看信息,我没有看到类似的错误消息。
gertvdijk 2012年

@gertvdijk我认为你是对的。该debconf: apt-extracttemplates failed: No such file or directory消息是相似的,但是我明白您的意思了:在这个问题中,该消息是次要的。installArchives() failed: E: Cannot get debconf version. Is debconf installed?消息中它是主要的错误消息(首先没有其他错误明确地解释出来)。
伊利亚·卡根

Answers:


18

这里解决这个问题的方法,超级简单的方法;)

有时您必须直接使用dpkg来解决此问题。

“再来一次”

软件包,multiarch-support is unpacked, but has never been configured这意味着该软件包将很快配置,但尚未配置。

状态unpacked为时,表示尚未安装该软件包,因此由于libgcc1尚未安装依赖项,因此无法安装该软件包,并且以前也无法安装multiarch-support

我们必须强制multiarch-support的安装状态来解决问题。

nano /var/lib/dpkg/status

找到以以下内容开头的行Package:

Package: multiarch-support
Status: install ok unpacked

您必须将更unpacked改为installed

现在尝试:

sudo dpkg --configure --pending
sudo apt-get install --reinstall multiarch-support libgcc1 debconf

我认为您可以通过这种方式使系统重新运行,请告诉我您是否可以这样做。


这解决了我在Raspbian和Pixel上遇到的一系列问题,包括基于UI的软件包管理器。我的/var/lib/dpkg目录完全丢失了,因此当它抱怨时,我确实必须创建该目录及其下的一些目录,但是最后,这现在允许我使用apt-get
stevieb

1

我相信您的/var/lib/dpkg目录及其内容搞砸了。主要是因为这条线,我认为您的包管理是无法恢复的。

multiarch-support is unpacked, but has never been configured.

另外,

apt-extracttemplates failed: No such file or directory

意味着/usr/bin/apt-extracttemplates在您的系统上不可用,这确实与众不同。

这本身并不会中断;造成数据损坏或用户错误(例如rm -rf files-you-should-never-delete)的原因。我最好的选择是备份数据(例如/home),然后从全新安装开始。


0

问题可能是您尚未debconf安装。要安装它或检查它是否已安装,请键入sudo apt-get install debconf一个终端。您可以CTRL-ALT-T同时按下以启动终端。

debconf如果未安装,则会安装此软件;如果已安装但已过期,则会进行升级;如果是最新的,则不执行任何操作。


1
我这样做,但这无济于事。
Mj125

1
我得到这个:debconf:PreDepends:perl-base(> = 5.6.1-4),但是它不会被安装
Mj125 2012年

1
@ Mj125,请执行以下操作:sudo apt-get install perl-base
Lucio)

不,我无法安装任何东西。
Mj125

sudo apt-get install perl-base debconf。尝试这个。两个软件包不应相互依赖。
Farid 2012年

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.