Debian(Linux)系统更换国内镜像源

得彼恩 Debian是一个轻量化的Linux系统,最新版的Debian12也仅仅只有600多MB。

轻量意味着精简了很多东西,更改国内镜像就折腾了一段时间,把步骤记录一下:

首先文本编辑器是不支持gedit这样图形化的,只能采用nano或vim等

1.  su 进入root模式

2.  nano /etc/apt/sources.list 修改源文件

3.  删除或使用#注释掉原内容,替换成以下内容,注意大小写,冒号、分号等

# 默认注释了源码镜像以提高 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

debian | 镜像站使用帮助 | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

如果是虚拟机的话,可以采用以下的方式直接粘贴

4.  Ctrl+X、Y、回车退出编辑器,执行apt-get update  

其他源参考这篇文章:

https://www.cnblogs.com/liuguanglin/p/debian11_repo.html

  • 11
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
树莓派的最新版本 Bullseye 使用的是 Debian 11 系统,下面是更换树莓派 Bullseye 版本的国内镜像源的详细步骤: 1. 打开终端,进入树莓派系统的命令行界面。 2. 备份原有的源列表文件: ``` sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak ``` 3. 使用编辑器(如 nano)打开源列表文件: ``` sudo nano /etc/apt/sources.list ``` 4. 删除原有的源列表内容,并添加以下内容(清华大学镜像源): ``` 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-security bullseye-security main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security 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 ``` 5. 保存文件并退出编辑器(按 Ctrl + X,然后按 Y 确认保存)。 6. 运行以下命令更新源列表: ``` sudo apt update ``` 7. 运行以下命令升级系统: ``` sudo apt upgrade ``` 8. 完成!你的树莓派系统 Bullseye 版本现在已经更换国内镜像源。 请注意,根据你所使用的树莓派系统版本,可能需要修改上述命令中的 "bullseye" 为对应的版本名。确保在更换镜像源时,你选择的是适用于你的树莓派系统版本的镜像源

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值