爲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.交流群: 2702237 13835667

相關課文
  • 防止退出linux終耑退出之後導致的nohup進程強制退出

  • Linux系統下word文档轉成pdf的辦法

  • ubuntu和debian安裝nginx或者tengine報錯, 找不到pcre依賴庫的解決辦法

  • 常見的web中間件請求返回狀態碼

我要說說
網上賓友點評