首页 > 其他分享 >Debian 11/12一键更换国内系统源

Debian 11/12一键更换国内系统源

时间:2025-01-07 20:12:48浏览次数:1  
标签:11 12 etc list apt cat sources Debian 粘贴

一、备份现有apt源配置

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

二、替换为其他apt源

Debian11

1、清华源

这是一条命令,全部复制后,直接粘贴然后一起执行。

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

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

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

deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bullseye-security main contrib non-free
EOF

2、中科大源

这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.ustc.edu.cn/debian/ bullseye main contrib non-free

deb https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.ustc.edu.cn/debian/ bullseye-updates main contrib non-free

deb https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.ustc.edu.cn/debian/ bullseye-backports main contrib non-free

deb https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free
# deb-src https://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free
EOF

3、腾讯云源

这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb http://mirrors.tencent.com/debian bullseye main contrib non-free
# deb-src http://mirrors.tencent.com/debian bullseye main contrib non-free

deb http://mirrors.tencent.com/debian bullseye-updates main contrib non-free
# deb-src http://mirrors.tencent.com/debian bullseye-updates main contrib non-free

deb http://mirrors.tencent.com/debian bullseye-backports main contrib non-free
# deb-src http://mirrors.tencent.com/debian bullseye-backports main contrib non-free

deb http://mirrors.tencent.com/debian-security bullseye-security main contrib non-free
# deb-src http://mirrors.tencent.com/debian-security bullseye-security main contrib non-free
EOF

4、阿里云源

这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.aliyun.com/debian/ bullseye main contrib non-free
# deb-src https://mirrors.aliyun.com/debian/ bullseye main contrib non-free

deb https://mirrors.aliyun.com/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main contrib non-free

deb https://mirrors.aliyun.com/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main contrib non-free

deb https://mirrors.aliyun.com/debian-security/ bullseye-security main contrib non-free
# deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main contrib non-free
EOF

5、华为源

这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.huaweicloud.com/debian/ bullseye main contrib non-free
# deb-src https://mirrors.huaweicloud.com/debian/ bullseye main contrib non-free

deb https://mirrors.huaweicloud.com/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.huaweicloud.com/debian/ bullseye-updates main contrib non-free

deb https://mirrors.huaweicloud.com/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.huaweicloud.com/debian/ bullseye-backports main contrib non-free

deb https://mirrors.huaweicloud.com/debian-security/ bullseye-security main contrib non-free
# deb-src https://mirrors.huaweicloud.com/debian-security/ bullseye-security main contrib non-free
EOF

6、网易源

这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.163.com/debian/ bullseye main non-free contrib
# deb-src https://mirrors.163.com/debian/ bullseye main non-free contrib

deb https://mirrors.163.com/debian/ bullseye-updates main non-free contrib
# deb-src https://mirrors.163.com/debian/ bullseye-updates main non-free contrib

deb https://mirrors.163.com/debian/ bullseye-backports main non-free contrib
# deb-src https://mirrors.163.com/debian/ bullseye-backports main non-free contrib

deb https://mirrors.163.com/debian-security/ bullseye-security main contrib non-free
# deb-src https://mirrors.163.com/debian-security/ bullseye-security main contrib non-free
EOF

Debian12

1、清华源

这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 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://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware
EOF

2、中科大源

这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free non-free-firmware

deb http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware

deb http://mirrors.ustc.edu.cn/debian bookworm-backports main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian bookworm-backports main contrib non-free non-free-firmware

deb http://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF

3、腾讯云源

这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib
# deb-src https://mirrors.tencent.com/debian/ bookworm main non-free non-free-firmware contrib

deb https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib
# deb-src https://mirrors.tencent.com/debian/ bookworm-updates main non-free non-free-firmware contrib

deb https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib
# deb-src https://mirrors.tencent.com/debian/ bookworm-backports main non-free non-free-firmware contrib

deb https://mirrors.tencent.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
# deb-src https://mirrors.tencent.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF

4、阿里云源

这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
# deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib

deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
# deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib

deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
# deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib

deb https://mirrors.aliyun.com/debian-security/ bookworm-security main non-free non-free-firmware contrib
# deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main non-free non-free-firmware contrib
EOF

5、华为源

这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.huaweicloud.com/debian/ bookworm main non-free non-free-firmware contrib
# deb-src https://mirrors.huaweicloud.com/debian/ bookworm main non-free non-free-firmware contrib

deb https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free non-free-firmware contrib
# deb-src https://mirrors.huaweicloud.com/debian/ bookworm-updates main non-free non-free-firmware contrib

deb https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free non-free-firmware contrib
# deb-src https://mirrors.huaweicloud.com/debian/ bookworm-backports main non-free non-free-firmware contrib

deb https://mirrors.huaweicloud.com/debian-security/ bookworm-security main non-free non-free-firmware contrib
# deb-src https://mirrors.huaweicloud.com/debian-security/ bookworm-security main non-free non-free-firmware contrib
EOF

6、网易源

这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.163.com/debian/ bookworm main non-free non-free-firmware contrib
# deb-src https://mirrors.163.com/debian/ bookworm main non-free non-free-firmware contrib

deb https://mirrors.163.com/debian/ bookworm-updates main non-free non-free-firmware contrib
# deb-src https://mirrors.163.com/debian/ bookworm-updates main non-free non-free-firmware contrib

deb https://mirrors.163.com/debian/ bookworm-backports main non-free non-free-firmware contrib
# deb-src https://mirrors.163.com/debian/ bookworm-backports main non-free non-free-firmware contrib

deb https://mirrors.163.com/debian-security/ bookworm-security main non-free non-free-firmware contrib
# deb-src https://mirrors.163.com/debian-security/ bookworm-security main non-free non-free-firmware contrib
EOF

三、更新apt索引

sudo apt update

标签:11,12,etc,list,apt,cat,sources,Debian,粘贴
From: https://www.cnblogs.com/aiguohou/p/18658276

相关文章

  • 如何在 Debian 11 上部署 pgAdmin4 教程
    如何在Debian11上部署pgAdmin4教程简介:pgAdmin4是PostgreSQL数据库的强大开源管理工具,它提供了一个友好的Web界面,用于管理PostgreSQL服务器和数据库。无论你是数据库管理员还是开发人员,pgAdmin4都能帮助你更高效地进行数据库管理。本教程旨在手把手教你如......
  • Luogu P3041 USACO12JAN Video Game G 题解 [ 紫 ] [ AC 自动机 ] [ 动态规划 ]
    VideoGamesG:弱智紫题,30min切了,dp思路非常板。多模式串一看肯定就是要建出AC自动机,然后在fail树里下传标记,预处理每个节点到达后的得分。然后设计\(dp_{i,j}\)表示第\(i\)个字符,AC自动机里匹配节点在\(j\)的最大答案,刷表法转移即可:\[dp_{i+1,ch_{j,c}}\gets\ma......
  • 【Day 11 LeetCode】二叉树的遍历
    一、二叉树的遍历二叉树的遍历主要分为深度优先遍历和广度优先遍历。深度优先是先往深处走,走到尽头返回;广度优先遍历是一层一层往下遍历。其中,深度优先遍历对应三种顺序,前序、中序、后序遍历,特点也很好记,就是根节点的位置。根节点位于前面就是前序,遍历顺序为根节点-左子......
  • jenkins入门12-- 权限管理
    Jenkins的权限管理由于jenkins默认的权限管理体系不支持用户组或角色的配置,因此需要安装第三发插件来支持角色的配置,我们使用Role-basedAuthorizationStrategy插件  只有项目读权限只有某个项目执行权限 ......
  • 开源flux适配昇腾NPU分享,体验120亿参数AI文生图模型
    这一期我们分享一位开源开发者参与flux适配昇腾NPU的实践经验,欢迎广大开发者对华为技术栈适配进行讨论。开源适配实践flux是一个AI图像生成模型,有120亿参数量,具有大量的用户基础,可以根据命令行输入的文字去生成对应的图片。本次适配使用的flux模型权重文件是schnell版本。下面......
  • win11一些优化【集合百度上的大佬】
    隐藏资源管理器窗口的主文件夹、图库、OneDrive:注册表编辑器使用Windows+R快捷键打开「运行」对话框,执行regedit打开注册表编辑器。⌈主文件夹⌋注册表路径:计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{f87431......
  • 代码随想录算法训练营第二十八天-贪心算法-122. 买卖股票的最佳时机II
    有奇妙的解法分析要获得利润,就是当天卖出前一天买入的的利润,也就是当天价格减去前一天的价格通过这样的运算,可以得到一个新的序列,这个序列就是上一道53的最大子序和的应用了而且把这些子序和中所有正数值都加到一起就是最大利润了#include<iostream>#include<vector>c......
  • 《刚刚问世》系列初窥篇-Java+Playwright自动化测试-11- 标签页(tab)操作 - 下篇 (详细教
    1.简介本来按照计划这一系列的文章应该介绍Context和Page两个内容的,但是宏哥看了官方文档和查找资料发现其实和宏哥在Python+Playwright系列文章中的大同小异,差不了多少,再在这一个系列介绍就有点画蛇添足,索性就不介绍和讲解了,有兴趣的自己可以看宏哥之前写的,或者自己查找资料和官......
  • 【Rust自学】11.1. 编写和运行测试
    喜欢的话别忘了点赞、收藏加关注哦(加关注即可阅读全文),对接下来的教程有兴趣的可以关注专栏。谢谢喵!(=・ω・=)11.1.1.什么是测试在Rust里一个测试就是一个函数,它被用于验证非测试代码的功能是否和预期一致。在一个测试的函数体里通常执行3个操作:准备(Arrange)数据/状态运......
  • 【Rust自学】11.2. 断言(Assert)
    喜欢的话别忘了点赞、收藏加关注哦(加关注即可阅读全文),对接下来的教程有兴趣的可以关注专栏。谢谢喵!(=・ω・=)11.2.1.使用assert!宏检查测试结果assert宏来自标准库,用来确定某个状态是否为true。这个宏可以接收一个返回类型为布尔类型的表达式:当assert!内的值为true时测试......