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

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.dtcms.com/a/351187.html

相关文章:

  • 在分布式环境下正确使用MyBatis二级缓存
  • 虚拟滚动优化——js技能提升
  • zookeeper-保姆级配置说明
  • http与https配置
  • 使用分流电阻器时的注意事项--PCB 设计对电阻温度系数的影响
  • Ubuntu 虚拟机配置 Git 并推送到Gitee
  • 低代码如何颠覆企业系统集成传统模式?快来一探究竟!
  • 两数之和,leetCode热题100,C++实现
  • 2025年视觉、先进成像和计算机技术论坛(VAICT 2025)
  • LeetCode热题100--108. 将有序数组转换为二叉搜索树--简单
  • 【Lua】题目小练11
  • Ansible 自动化运维工具:介绍与完整部署(RHEL 9)
  • 【软考论文】论领域驱动开发方法(DDD)的应用
  • CentOS 7服务器初始化全攻略:从基础配置到安全加固
  • AI应用--接口测试篇
  • Maya绑定基础:驱动关键帧的使用
  • C# .NET支持多线程并发的压缩组件
  • 视频创作者如何用高级数据分析功能精准优化视频策略
  • 红色文化与前沿科技的融合:VR呈现飞夺泸定桥的震撼历史场景​
  • LWIP协议栈
  • Java项目-苍穹外卖_Day3-Day4
  • MyBatis-Flex:一个支持关联查询的MyBatis
  • android vehicle
  • SOME/IP-SD协议含配置选项键值信息的报文示例解析
  • 贝叶斯优化提升化学合成反应效率(附源码)
  • 如何将数据从vivo手机传输到另一部vivo手机
  • 《高并发场景下数据一致性隐疾的实战复盘》
  • Coze Studio开源版:AI Agent开发平台的深度技术解析- 入门篇
  • 深度学习篇---LeNet-5网络结构
  • iOS 开发中的 UIStackView 使用详解