乐云主机笔记

  • 首页
  • 学习记录
  • 资源下载
  • 新手教程
  • 其他
  • 脚本源码
  • 自用主机
  • 主机优惠
  • 域名优惠
  • 网赚项目

  1. 首页
  2. 新手教程
  3. 正文

Debian9更换Archive源解决apt 404问题|换源

2023年 12月 6日 1060点热度 0人点赞 0条评论

Debian 9系统已于2023年7月6日正式eol,和CentOS一样写个临时的换源解决方法吧。题图还是用以前的了,最近事情多不想重新做一张,反正大同小异~

 

一、选择Archive源

目前Debian archive官方源及国内镜像主要有以下几个,按照推荐的顺序自上而下排列。翻看了一圈国内的镜像站发现archive非商业源很少,商业源中阿里云较为稳定但目前对外限速非常严重,不推荐使用。

官方(海外):http://archive.debian.org/
腾讯云:http://mirrors.cloud.tencent.com/debian-archive/
南京大学:https://mirror.nju.edu.cn/debian-archive/
软件所:https://mirror.iscas.ac.cn/debian-archive/
网易163:http://mirrors.163.com/debian-archive/
阿里云:http://mirrors.aliyun.com/debian-archive/


二、配置镜像源

Debian的镜像源主要分为主线、updates、backports三项。既然已经是过了支持期的老旧系统,updates条目博主觉得不是必要的内容了,要更新还是建议更新到在支持期内的新系统。backports源中的内容是将新版本的某些功能移植到旧版本软件上,如果你不知道它的作用也不必添加。所以一般情况下仅配置主源就够了,再按照需求决定是否添加backports源。

# 基础源

deb [check-valid-until=no] http://archive.debian.org/debian/ stretch main non-free contrib

deb-src [check-valid-until=no] http://archive.debian.org/debian/ stretch main non-free contrib

# Sercurity Updates源

deb [check-valid-until=no] http://archive.debian.org/debian-security/ stretch/updates main contrib non-free

deb-src [check-valid-until=no] http://archive.debian.org/debian-security/ stretch/updates main contrib non-free

# backports源

deb [check-valid-until=no] http://archive.debian.org/debian/ stretch-backports main non-free contrib

deb-src [check-valid-until=no] http://archive.debian.org/debian/ stretch-backports main non-free contrib

其中系统版本是可以替换的,Debian9代号stretch,Debian8代号jessie,Debian7代号wheezy,Debian6代号squeeze。替换为需要的镜像源和版本后,使用vi、nano等工具,覆盖到/etc/apt/sources.list即可。


三、一键更换

以下提供几个博主写好的配置供一键替换,其中只启用了Debian的主源,有额外的需要请自行取消注释。里面的条目没有使用https,因为部分系统没有安装apt-transport-https包。对较早的Debian6-8在此使用的是以前写的Snapshot源,正常使用是没有问题的。

 

#备份源文件

mv /etc/apt/sources.list /etc/apt/sources.list.bak

#替换为官方源(注意版本)

 

debian9

wget -O /etc/apt/sources.list https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Debian-9-archive.list

或者:

wget -O /etc/apt/sources.list https://pic.letcloud.cn/wp-content/uploads/2023/12/20231228145003363.txt

 

debian8

wget -O /etc/apt/sources.list https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Debian-8-Snapshot.list

或者

wget -O /etc/apt/sources.list  https://pic.letcloud.cn/wp-content/uploads/2023/12/20231228145257776.txt

 

debian7

wget -O /etc/apt/sources.list https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Debian-7-Snapshot.list

或者

wget -O /etc/apt/sources.list https://pic.letcloud.cn/wp-content/uploads/2023/12/20231228145438338.txt

debian6

wget -O /etc/apt/sources.list https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Debian-6-Snapshot.list

或者

wget -O /etc/apt/sources.list https://pic.letcloud.cn/wp-content/uploads/2023/12/20231228145611485.txt

 

#替换为腾讯源(注意版本)

wget -O /etc/apt/sources.list https://static.lty.fun/%E5%85%B6%E4%BB%96%E8%B5%84%E6%BA%90/SourcesList/Debian-9-archive-qcloud.list

或者

wget -O /etc/apt/sources.list https://pic.letcloud.cn/wp-content/uploads/2023/12/20231228145736409.txt

 


四、结语

最后还是得说一句,虽然更换Archive源能够保证系统基础功能正常,但是已经进入EoL的系统失去了官方的更新和维护,日后有可能会因为一些漏洞而被入侵,如果可以的话还是建议更新到最新版本受支持的系统。

Debian

Debian的源备份有两种,除了我们上面提到的最终源Debian Archive,还有定时备份的快照镜像Snapshot。Archive源会移除较早发行版的二进制文件只保留源代码,Snapshot则是定期保存的完整快照,可以按照自己的需求去选择。

Debian Snapshot:http://snapshot.debian.org/

Ubuntu

遇到Ubuntu旧版系统源404的问题,可以使用Old Release源。

Ubuntu Old Release:http://old-releases.ubuntu.com/ubuntu/
Old Release镜像:http://mirrors.ustc.edu.cn/ubuntu-old-releases/ubuntu/

CentOS

关于CentOS旧版系统源404的问题,博主曾经的文章有写过,在这里就不再赘述了。

【揭棺而起】CentOS 6更换Valut源解决Yum 404问题

相信已经有一部分朋友今天连接到CentOS 6的服务器后执行yum后发现出现404的报错,那么发生了什么?

原因是CentOS 6已经随着2020年11月的结束进入了EOL(Rea ...

 


*原文地址,https://luotianyi.vc/4957.html

标签: 暂无
最后更新:2023年 12月 6日

wangzhe12588

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

归档

  • 2025 年 5 月
  • 2025 年 4 月
  • 2025 年 3 月
  • 2025 年 2 月
  • 2025 年 1 月
  • 2024 年 12 月
  • 2024 年 11 月
  • 2024 年 10 月
  • 2024 年 9 月
  • 2024 年 7 月
  • 2024 年 3 月
  • 2024 年 2 月
  • 2024 年 1 月
  • 2023 年 12 月
  • 2023 年 11 月
  • 2023 年 10 月
  • 2023 年 9 月
  • 2023 年 8 月
  • 2023 年 7 月
  • 2023 年 6 月
  • 2023 年 5 月
  • 2023 年 4 月
  • 2023 年 3 月
  • 2023 年 2 月
  • 2023 年 1 月
  • 2022 年 12 月
  • 2022 年 11 月
  • 2022 年 10 月
  • 2022 年 9 月
  • 2022 年 8 月
  • 2022 年 7 月
  • 2022 年 6 月
  • 2022 年 5 月
  • 2022 年 4 月
  • 2022 年 3 月
  • 2022 年 2 月
  • 2022 年 1 月
  • 2021 年 12 月
  • 2021 年 11 月
  • 2021 年 10 月
  • 2021 年 9 月
  • 2021 年 8 月
  • 2021 年 7 月
  • 2021 年 6 月
  • 2021 年 5 月
  • 2021 年 4 月
  • 2021 年 3 月
  • 2021 年 2 月
  • 2021 年 1 月
  • 2020 年 12 月
  • 2020 年 11 月
  • 2020 年 10 月
  • 2020 年 9 月
  • 2020 年 8 月
  • 2020 年 7 月
  • 2020 年 6 月
  • 2020 年 5 月
  • 2020 年 4 月
  • 2020 年 3 月
  • 2020 年 2 月
  • 2020 年 1 月
  • 2019 年 12 月
  • 2019 年 11 月
  • 2019 年 10 月
  • 2019 年 9 月
  • 2019 年 8 月
  • 2019 年 7 月
  • 2019 年 6 月
  • 2019 年 5 月
  • 2019 年 4 月
  • 2019 年 3 月
  • 2019 年 2 月
  • 2019 年 1 月
  • 2018 年 12 月
  • 2018 年 11 月
  • 2018 年 10 月
  • 2018 年 9 月
  • 2018 年 8 月
  • 2018 年 7 月
  • 2018 年 6 月
  • 2018 年 5 月
  • 2018 年 4 月
  • 2018 年 3 月
  • 2018 年 2 月
  • 2017 年 12 月
  • 2017 年 11 月
  • 2017 年 10 月
  • 2017 年 9 月
  • 2017 年 8 月
  • 2017 年 7 月

分类

  • 主机优惠
  • 其他
  • 域名优惠
  • 学习记录
  • 新手教程
  • 网赚项目
  • 脚本源码
  • 自用主机
  • 资源下载

COPYRIGHT © 2021 Letcloud.cn. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

粤ICP备15031609号-3