前言

本来debian在安装的时候就可以选择国内的源,本来我以为这样就行了,不用自己在手动换,结果今天在使用更新命令时就给我卡住了,开始请求官方源了。

难崩,还得自己换源解决问题。

教程

我们需要打开源文件:/etc/apt/sources.list ,你可以使用nano编辑或者ssh软件自带的文件管理功能修改文件。

将里面debdep-src全部注释,注意这个注释是在每行前面加#号,大概如下:

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

# deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
# deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware

# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
# deb http://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free-firmware
# deb-src http://mirrors.ustc.edu.cn/debian/ bookworm-updates main non-free-firmware

然后我们插入需要更换的源,我比较喜欢中科大的源,这里贴一下:

deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware

粘贴到sources.list文件内后保存,然后调用命令:sudo apt update 重新拉一下索引文件。

然后就可以使用sudo apt-get upgrade更新依赖了。

其他源

腾讯源

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-security/ bookworm-security main
deb-src https://mirrors.tencent.com/debian-security/ bookworm-security main
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.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-security/ bookworm-security main
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
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.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-security/ bookworm-security main
deb-src https://mirrors.163.com/debian-security/ bookworm-security main
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
分类: 运维 标签: 更新换源debian12

评论

全部评论 1

  1. wu先生
    wu先生
    Google Chrome Windows 10
    不明觉历。[呲牙]

目录