由于(虚拟)包缺失或损坏,无法安装

由于(虚拟)包缺失或损坏,无法安装

首先:我来自 stackoverflow - 我是一名程序员,不是系统管理员。请理解我对这些问题的无能;我会尽量做到准确(重新标记和重新命名可能是合适的)。

我遇到了依赖关系问题,无法在 Debian Etch 系统上解决。
有人叫我维护一个 php 应用程序;因为我需要这个locales包,所以我尝试了我认为最简单的方法:apt-get install locales,但由于虚拟 glibc 包的依赖关系未得到满足,所以失败了。据我所知,这是由混合源引起的(所有包都已升级)
我问aptitude install locales他是否可以修复问题,他确实修复了(一些包被降级了),但 aptitude 本身被删除了。
没有讨论:这是我的愚蠢之举。但服务器仍在正常运行(感谢 Debian!),因此情况并不严重。

问题是:软件包问题似乎没有解决。如果我尝试重新安装 aptitude,我得到的结果是:

lsrl:~# apt-get install aptitude
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  aptitude: Depends: libapt-pkg-libc6.3-6-3.11
E: Broken packages

如果我尝试安装 libapt:

lsrl:~# apt-get install libapt-pkg-libc6.3-6-3.11
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libapt-pkg-libc6.3-6-3.11 is a virtual package provided by:
You should explicitly select one to install.
E: Package libapt-pkg-libc6.3-6-3.11 has no installation candidate

如果我尝试重新安装 apt:

lsrl:~# apt-get --reinstall install apt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Reinstallation of apt is not possible, it cannot be downloaded.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

我的消息来源:

lsrl:~# cat /etc/apt/sources.list
# 
# deb cdrom:[Debian GNU/Linux 4.0 r4a-etchnhalf _Etch-and-a-half_ - Official i386 NETINST 20080804-22:00]/ etch main

#deb cdrom:[Debian GNU/Linux 4.0 r4a-etchnhalf _Etch-and-a-half_ - Official i386 NETINST 20080804-22:00]/ etch main

deb http://ftp.it.debian.org/debian/ etch main contrib non-free
deb-src http://ftp.it.debian.org/debian/ etch main contrib non-free
# deb http://ftp.it.debian.org/debian/ testing main contrib non-free
# deb-src http://ftp.it.debian.org/debian/ testing main contrib non-free

deb http://security.debian.org/ etch/updates main contrib non-free
deb-src http://security.debian.org/ etch/updates main contrib non-free

deb http://volatile.debian.org/debian-volatile etch/volatile main
deb-src http://volatile.debian.org/debian-volatile etch/volatile main

这与 glibc 之前的情况非常相似,我有理由相信仍然存在一些混合源/包... 有吗?
有什么方法可以让所有这些正常工作?

答案1

在 etch 上,apt 包应该提供 libapt-pkg-libc6.3-6-3.11,但在你的情况下似乎并非如此。你能检查一下你的 apt 是否提供了它吗?

apt-cache show apt | grep "Provides:"

然后,它说无法下载 apt。你确定apt-get update在尝试安装命令之前运行了吗?如果你的 sources.list 之前被破坏了,然后又被修复了,那么只有在你更新 apt 缓存后,更改才会被考虑在内。

答案2

您是否尝试过不带参数的“apt-get -f install”?

来自 apt-get 手册页:

-f, --fix-broken 修复;尝试纠正存在损坏依赖关系的系统

相关内容