从 Debian Stable (Buster) 成功安装 DDD 调试器时遇到问题
当我尝试安装 ddd 时,安装失败并出现错误:
robert@pip2:/tmp$ sudo -l
[sudo] password for robert:
Matching Defaults entries for robert on pip2:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\: /usr/sbin\:/usr/bin\:/sbin\:/bin
User robert may run the following commands on pip2:
(ALL : ALL) ALL
robert@pip2:/tmp$ sudo aptitude install ddd
The following NEW packages will be installed:
ddd gdb{a} libbabeltrace1{a} libc6-dbg{a} libipt2{a} libmotif-common{a} libxm4{a}
0 packages upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,456 kB/24.4 MB of archives. After unpacking 44.1 MB will be used.
Do you want to continue? [Y/n/?]
Err http://deb.debian.org/debian buster/main i386 libbabeltrace1 i386 1.5.6-2
404 Not Found [IP: 2a04:4e42:2d::204 80]
Err http://deb.debian.org/debian buster/main i386 gdb i386 8.2.1-2
404 Not Found [IP: 2a04:4e42:2d::204 80]
86% [Working]E: Failed to fetch http://deb.debian.org/debian/pool/main/b/babeltrace/libbabeltrace1_1.5.6-2_i386.deb: 404 Not Found [IP: 2a04:4e42:2d::204 80]
E: Unable to fetch some packages; try '-o APT::Get::Fix-Missing=true' to continue with missing packages
robert@pip2:/tmp$
我是通过 netinst 安装的,没有任何自定义,只是默认桌面安装。
不确定要对 resources.list 进行哪些调整,因为这是我第一次在安装软件包时遇到问题。
我的 /etc/apt/sources.list 文件:
robert@pip2:/etc/apt$ cat ./sources.list
#
# deb cdrom:[Debian GNU/Linux 10.0.0 _Buster_ - Official i386 NETINST 20190706-11:30]/ buster main
#deb cdrom:[Debian GNU/Linux 10.0.0 _Buster_ - Official i386 NETINST 20190706-11:30]/ buster main
deb http://deb.debian.org/debian/ buster main contrib
deb-src http://deb.debian.org/debian/ buster main contrib
deb http://security.debian.org/debian-security buster/updates main contrib
deb-src http://security.debian.org/debian-security buster/updates main contrib
# buster-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ buster-updates main contrib
deb-src http://deb.debian.org/debian/ buster-updates main contrib
# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
robert@pip2:/etc/apt$
编辑2019-10-13
一条评论被问到
“请将 的输出添加apt-get update
到问题中。”
这里是:
robert@pip2:/tmp$ sudo apt-get update
Hit:1 http://deb.debian.org/debian buster InRelease
Get:2 http://deb.debian.org/debian buster-updates InRelease [49.3 kB]
Hit:3 http://security.debian.org/debian-security buster/updates InRelease
Fetched 49.3 kB in 2s (29.8 kB/s)
Reading package lists... Done
robert@pip2:/tmp$
编辑2019-10-14
另一条评论询问了 md5sum 值。这里是:
robert@pip2:/tmp$ sudo md5sum /var/lib/apt/lists/deb.debian.org_debian_dists_buster_InRelease
9c0457c7c76f7eca24842cfb62de7f77 /var/lib/apt/lists/deb.debian.org_debian_dists_buster_InRelease
编辑 2019-10-19 尝试安装 libbabeltrace1
robert@pip2:/tmp$ sudo aptitude install libbabeltrace1
[sudo] password for robert:
The following NEW packages will be installed:
libbabeltrace1
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 191 kB of archives. After unpacking 612 kB will be used.
Err http://deb.debian.org/debian buster/main i386 libbabeltrace1 i386 1.5.6-2
404 Not Found [IP: 151.101.188.204 80]
0% [Working]E: Failed to fetch http://deb.debian.org/debian/pool/main/b/babeltrace/libbabeltrace1_1.5.6-2_i386.deb: 404 Not Found [IP: 151.101.188.204 80]
E: Unable to fetch some packages; try '-o APT::Get::Fix-Missing=true' to continue with missing packages
robert@pip2:/tmp$
答案1
libbabeltrace1 的当前版本http://ftp.fr.debian.org/debian/pool/main/b/babeltrace/是 libbabeltrace1_1.5.6-2+deb10u1_i386.deb
您的跟踪显示 libbabeltrace1_1.5.6-2_i386.deb 这是一个旧版本,在存储库中不再可用,因此出现 404 错误。
这意味着您的软件包列表不是最新的。如果 apt update 无法更新它们,最简单的方法是删除它们以强制下载干净的。
尝试这个 :
sudo su
apt clean
rm /var/lib/apt/lists/*debian*
apt update
apt install ddd
答案2
根据前面的答案,我执行了相同的步骤,但使用了aptitude
,而不是apt
,并取得了成功的结果。我将把它标记为已接受的答案。
我仍然不知道为什么我必须执行这些额外的清理和清除步骤(这是作为 Debian 用户第一次必须对我的 PC 的 pkg mgmt 进行故障排除,而且我一直是 Debian用户a长的时间),但它确实有效:
robert@pip2:/tmp$ sudo aptitude clean
robert@pip2:/tmp$ sudo rm /var/lib/apt/lists/*debian*
robert@pip2:/tmp$ sudo aptitude update
robert@pip2:/tmp$ sudo aptitude install ddd