为debian更换国内apt源

字号+ 编辑: 种花家 修订: 种花家 来源: 阿里云开发者 2023-12-06 我要说两句(0)

用deb.debian.org的实在是太慢了, 干脆换个源吧!

每个debian系统版本不一样, 那数据源站的地址也不一样, 可别搞混了...

简介

Debian GNU/Linux,是一个操作系统及自由软件的发行版,由一群自愿付出时间和精力的用户来维护并更新。它附带了超过 59000 个软件包,这些预先编译好的软件被打包成一种良好的格式以便于用户安装和使用。

下载地址: https://mirrors.aliyun.com/debian/

相关仓库

Debian安装源(debian-cd):https://developer.aliyun.com/mirror/debian-cd

Debian安全更新源(debian-security):https://developer.aliyun.com/mirror/debian-security

Debian第三方多媒体软件源(debian-multimedia):https://developer.aliyun.com/mirror/debian-multimedia

Debian预发软件源(debian-backports):https://developer.aliyun.com/mirror/debian-backports

Debian其他架构移植源(debian-ports):https://developer.aliyun.com/mirror/debian-ports

Debian过期源(debian-archive):https://developer.aliyun.com/mirror/debian-archive

配置方法

debian 7.x (wheezy)

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

deb https://mirrors.aliyun.com/debian-archive/debian/ wheezy main non-free contrib
deb https://mirrors.aliyun.com/debian-archive/debian/ wheezy-proposed-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian-archive/debian/ wheezy main non-free contrib
deb-src https://mirrors.aliyun.com/debian-archive/debian/ wheezy-proposed-updates main non-free contrib

debian 8.x (jessie)

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

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

debian 9.x (stretch)

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

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

debian 10.x (buster)

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

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

debian 11.x (bullseye)

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

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

debian 12.x(书虫)中科大源

编辑/etc/apt/sources.list文件(需要使用sudo), 在文件最前面添加以下条目(操作前请做好相应备份)

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

附: 不用vim/nano直接shell echo命令写入文件到apt配置单

笔者有时候需要用debian:stable-slim版制作镜像, 公网镜像中是不带记事本工具的, 如果在海外在线更新apt库表得等很久, 用echo命令解决。例如,用echo命令注入上文中的书虫库。

echo "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" > /etc/apt/sources.list

再执行apt-get update使用国内镜像更新, 更加快。

完结撒花

阅完此文,您的感想如何?
  • 有用

    125

  • 没用

    6

  • 开心

    19

  • 愤怒

    2

  • 可怜

    2

1.如文章侵犯了您的版权,请发邮件通知本站,该文章将在24小时内删除;
2.本站标注原创的文章,转发时烦请注明来源;
3.交流群: PHP+JS聊天群

相关课文
  • Linux系统下word文档转成pdf的办法

  • ubuntu和debian安装nginx或者tengine报错, 找不到pcre依赖库的解决办法

  • linux终端下借助awk命令查询筛出网站access.log日志里的统计信息

  • 常见的web中间件请求返回状态码

我要说说
网上宾友点评