Debian更换国内源

发布于 8 天前  34 次阅读


AI 摘要

为了更换 Debian 系统的国内源,可以修改 `/etc/apt/sources.list` 文件,添加阿里云镜像地址。若遇到无法拉取 HTTPS 源的情况,可先通过 HTTP 源安装 `apt-transport-https` 和 `ca-certificates`。此外,可通过一键换源脚本快速完成配置,命令为: ```bash bash <(curl -sSL https://linuxmirrors.cn/main.sh) ```

修改/etc/apt/sources.list

deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian-security buster/updates main
deb-src http://mirrors.aliyun.com/debian-security buster/updates main
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib

如果遇到无法拉取 https 源的情况,请先使用 http 源并安装:

sudo apt install apt-transport-https ca-certificates

一键换源项目官网

bash <(curl -sSL https://linuxmirrors.cn/main.sh)
  • alipay_img
  • wechat_img
公众号:享生活爱羊毛
最后更新于 2025-03-07