在 Debian 里你提到 “fetchdebian 报错”,先确认一下你说的 fetchdebian 具体是哪一个:
fetch-debian / fetchdebian 第三方脚本/工具apt / apt-get 在 fetch 阶段报错(下载仓库索引失败)fetchdebian 命令(比如构建镜像、打包工具)下面按最常见情况给你排查思路。
apt update 时“fetch”报错(最常见)典型报错类似:
Failed to fetch http://deb.debian.org/debian/dists/...
Unable to fetch some archives
ping deb.debian.org
curl -I http://deb.debian.org
换国内源(如清华):
sudo sed -i 's|deb.debian.org|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
sudo apt update
比如:
查看:
cat /etc/apt/sources.list
报错含:
certificate verification failed
解决:
sudo apt install ca-certificates
sudo update-ca-certificates
date
不对就同步:
sudo apt install ntpdate
sudo ntpdate pool.ntp.org
NO_PUBKEY xxxxxxxx
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys XXXXXXXX
fetchdebian 脚本常见原因:
wget/curl/rsync 没装你可以这样看错误:
bash -x fetchdebian
你可以把完整报错原文贴出来,比如:
我可以精准告诉你哪一行出了问题,而不是泛泛而谈。
你是 apt update 报错,还是某个 fetchdebian 脚本?