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

Debian系统换源为阿里云镜像源

参考链接

  1. https://blog.csdn.net/peng2hui1314/article/details/113247648

  2. https://blog.stiny.cn/archives/589.html

  3. https://mirrors.tuna.tsinghua.edu.cn/help/debian/

查看当前镜像源

less -N /etc/apt/sources.list

可以看到使用的是Debian 默认的源地址 http://deb.debian.org/

备份

没人希望出问题,但是还是要备份

cp /etc/apt/sources.list /etc/apt/sources.list.bak

修改文件

使用vim打开文件

sudo vim /etc/apt/sources.list
# 打开文件后直接输入 ggdG 清空文件
ggdG

将以下代码输入空文件内(下面代码来自清华大学开源软件镜像站:https://mirrors.tuna.tsinghua.edu.cn/help/debian/)

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware

# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware

更新镜像源

sudo apt-get update

http://www.kler.cn/a/566079.html

相关文章:

  • 三个小时学完vue3(一)
  • Opencv之图像SIFT 特征检测与Harris角点检测
  • Go基于协程池的延迟任务调度器
  • js基础案例
  • 如何利用Java爬虫获取1688商品详情实战指南
  • Docker迁移/var/lib/docker之后镜像容器丢失问题
  • 初阶数据结构习题【3】(1时间和空间复杂度)——203移除链表元素
  • 渲染 101:Maya 项目的高效渲染利器
  • 使用Docker方式一键部署MySQL和Redis数据库详解
  • C语言数据类型及其使用 (带示例)
  • 数字样机:从技术革新到产业赋能的演进之路
  • 【AI+智造】基于阿里云Ubuntu24.04系统,使用Ollama部署开源DeepSeek模型并集成到企业微信
  • 华为云Deepseek API接口访问速率问题
  • Datawhale 数学建模导论二 笔记5 多模数据与智能模型
  • 服务器禁止操作汇总(Server Prohibits 0peration Summary)
  • 使用 Docker 管理 Alpine 镜像的完整指南
  • 【初阶数据结构】星河中的光影 “排” 象:排序(上)
  • Octave3D 关卡设计插件
  • GaussDB SQL 调优:从执行计划到AI驱动的进阶指南
  • 【搜广推算法的力量:如何用数据驱动用户体验与商业价值?】