当前位置: 首页 > java >正文

Debian Buster 软件源失效问题

一、问题背景

在维护一台基于 Debian Buster (10) 的 ARM64 设备(Linaro ALIP)时,发现 apt update 命令无法正常更新软件包列表,报错 404 Not Found。经过排查,确认问题源于 Debian Buster 已结束官方支持(EOL),主流镜像站(如清华源、官方源)已移除其仓库文件。


二、问题复现

1. 初始错误

执行 sudo apt update 时,报错如下:

bash

E: 仓库 “http://deb.debian.org/debian buster Release” 没有 Release 文件。
E: 仓库 “http://security.debian.org/debian-security buster/updates Release” 没有 Release 文件。

原因:Debian Buster 已于 2022 年 9 月停止维护,官方镜像站不再提供其软件源。

2. 尝试切换清华源

修改 /etc/apt/sources.list 为清华镜像站:

bash

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free

但 apt update 仍报 404,说明清华源也已移除 Buster 仓库。

3. 验证软件源状态

通过 curl 检查 Release 文件是否存在:

bash

curl -I https://mirrors.tuna.tsinghua.edu.cn/debian/dists/buster/Release
# 返回 HTTP/2 404,确认源已失效

三、解决方案

方法 1:使用 Debian 官方存档源(推荐临时使用)

Debian 将旧版本移至 archive.debian.org,需手动修改 sources.list 并禁用安全检查。

步骤 1:修改软件源

bash

sudo bash -c 'cat > /etc/apt/sources.list' <<EOF
deb http://archive.debian.org/debian buster main contrib non-free
deb http://archive.debian.org/debian-security buster/updates main contrib non-free
deb http://archive.debian.org/debian buster-updates main contrib non-free
EOF

步骤 2:禁用 APT 的过期仓库检查

bash

sudo apt update -o Acquire::Check-Valid-Until=false

说明Acquire::Check-Valid-Until=false 允许使用已过期的仓库元数据。

步骤 3(可选):允许非安全源

如果仍报错,可临时允许未认证的源(不推荐长期使用):

bash

sudo apt -o Acquire::Check-Valid-Until=false -o APT::Get::AllowUnauthenticated=true update

方法 2:升级到受支持的 Debian 版本(推荐长期方案)

由于 Buster 已停止维护,建议升级到 Debian 11 (Bullseye) 或 Debian 12 (Bookworm)

步骤 1:修改软件源为 Bullseye

bash

sudo bash -c 'cat > /etc/apt/sources.list' <<EOF
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
EOF

步骤 2:执行完整升级

bash

sudo apt update && sudo apt full-upgrade -y
sudo reboot

说明full-upgrade 会处理依赖关系变更,确保系统平滑升级。


方法 3:使用第三方镜像(不推荐)

部分第三方镜像(如中科大)可能保留旧版本,但存在安全风险。示例配置:

bash

deb https://mirrors.ustc.edu.cn/debian-archive/debian buster main contrib non-free

警告:第三方源可能随时失效,且不提供安全更新。


四、其他问题修复

1. NTP 时间同步失败

错误日志:

bash

ntpdate[1459]: the NTP socket is in use, exiting

解决方案

  • 停止 ntp 服务并强制使用 UDP 端口:

    bash

    sudo systemctl stop ntp
    sudo ntpdate -u pool.ntp.org
  • 或改用 systemd-timesyncd

    bash

    sudo timedatectl set-ntp true

2. 清理残留配置

bash

sudo apt clean
sudo apt autoremove -y

五、总结与建议

  1. Debian Buster 已 EOL:主流镜像站不再提供支持,需切换到存档源或升级版本。
  2. 推荐升级:长期方案应选择 Debian 11/12,以获得安全更新和功能改进。
  3. 谨慎使用第三方源:避免引入未知风险,尤其是涉及安全更新的软件。

六、附录:完整操作记录

1. 检查当前架构

bash

dpkg --print-architecture # 输出: arm64

2. 验证软件源状态

bash

curl -I https://mirrors.tuna.tsinghua.edu.cn/debian/dists/buster/Release
# HTTP/2 404 Not Found

3. 切换到存档源并更新

bash

sudo sed -i 's|deb.debian.org|archive.debian.org|g' /etc/apt/sources.list
sudo apt update -o Acquire::Check-Valid-Until=false

4. 升级到 Debian Bullseye(示例)

bash

sudo sed -i 's/buster/bullseye/g' /etc/apt/sources.list
sudo apt update && sudo apt full-upgrade -y

七、参考资料

  • Debian End-of-Life 公告
  • archive.debian.org 文档
  • Debian 升级指南
http://www.xdnf.cn/news/18837.html

相关文章:

  • vue2+elementui 表格单元格增加背景色,根据每列数据的大小 颜色依次变浅显示2
  • zookeeper-保姆级配置说明
  • 深度学习篇---ResNet-18网络结构
  • 【算法--链表题1】2. 两数相加:通俗详解
  • 用大语言模型实现语音到语音翻译的新方法:Scheduled Interleaved Speech-Text Training
  • 论文Review 激光3DGS GS-SDF | IROS2025 港大-MARS!| 激光+3DGS+NeRF会得到更好的几何一致性和渲染结果!?
  • React前端开发_Day1
  • Linux虚拟机ansible部署
  • OSPF 的工作过程、Router ID 机制、报文结构
  • Axios多实例封装
  • 产品运营必备职场通用能力及提升攻略,一文说明白
  • Kafa面试经典题--Kafka为什么吞吐量大,速度快
  • 字帖生成器怎么用?电脑手机双端操作指南
  • 【图像算法 - 24】基于深度学习与 OpenCV 实现人员跌倒识别系统(目标检测方案 - 跌倒即目标)
  • 如何在PC上轻松访问iPhone照片(已解决)
  • 【LeetCode - 每日1题】求对角线最长矩形的面积
  • WebSocket实时通信系统——js技能提升
  • 系统架构设计师备考第7天——网络协议中间件软件构件
  • 计算机网络:天气预报
  • Vue3 + Element Plus实现表格多行文本截断与智能Tooltip提示
  • 论文阅读 2025-8-26 一些半监督学习的工作
  • 04. 鸿蒙_获取app缓存大小和清除缓存
  • iOS 开发中的 UIStackView 使用详解
  • 飞算JavaAI:Java开发新时代的破晓之光
  • 【软考论文】论面向对象建模方法(动态、静态)
  • Go函数详解:从基础到高阶应用
  • 数据结构:单向链表的逆置;双向循环链表;栈,输出栈,销毁栈;顺序表和链表的区别和优缺点;0825
  • Java的四种优化资源密集型任务的策略
  • 每日一题——力扣498 对角线遍历
  • CentOS 部署 Prometheus 并用 systemd 管理