查看: 99|回覆: 0

[Debian] debian更换apt的源

[複製鏈接]

1

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2009-1-23
發表於 2025-2-28 20:28:00 | 顯示全部樓層 |閲讀模式
nano /etc/apt/sources.list

Debian12一键换阿里云源的脚本

mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo '
deb http://mirrors.cloud.aliyuncs.com/debian bookworm main non-free-firmware
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm main non-free-firmware
deb http://mirrors.cloud.aliyuncs.com/debian-security bookworm-security main non-free-firmware
deb-src http://mirrors.cloud.aliyuncs.com/debian-security bookworm-security main non-free-firmware
deb http://mirrors.cloud.aliyuncs.com/debian bookworm-updates main non-free-firmware
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm-updates main non-free-firmware
deb http://mirrors.cloud.aliyuncs.com/debian bookworm-backports main non-free-firmware
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm-backports main non-free-firmware
'>/etc/apt/sources.list.d/aliyun.list

Debian12默认源

#deb cdrom:[Debian GNU/Linux 12.9.0 _Bookworm_ - Official amd64 NETINST with firmware 20250111-10:54]/ bookworm contrib main non->

deb http://deb.debian.org/debian/ bookworm main non-free-firmware
deb-src http://deb.debian.org/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://deb.debian.org/debian/ bookworm-updates main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

Debian12阿里云源

## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
##     or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.debian.tmpl
###

# See http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.html
# for how to upgrade to newer versions of the distribution.
deb http://mirrors.cloud.aliyuncs.com/debian bookworm main
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm main

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.cloud.aliyuncs.com/debian-security bookworm-security main
deb-src http://mirrors.cloud.aliyuncs.com/debian-security bookworm-security main
deb http://mirrors.cloud.aliyuncs.com/debian bookworm-updates main
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm-updates main

## Uncomment the following two lines to add software from the 'backports'
## repository.
##
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
deb http://mirrors.cloud.aliyuncs.com/debian bookworm-backports main
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm-backports main

去掉注解后的debian12阿里云源

deb http://mirrors.cloud.aliyuncs.com/debian bookworm main
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm main
deb http://mirrors.cloud.aliyuncs.com/debian-security bookworm-security main
deb-src http://mirrors.cloud.aliyuncs.com/debian-security bookworm-security main
deb http://mirrors.cloud.aliyuncs.com/debian bookworm-updates main
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm-updates main
deb http://mirrors.cloud.aliyuncs.com/debian bookworm-backports main
deb-src http://mirrors.cloud.aliyuncs.com/debian bookworm-backports main

这是Debian11阿里云

## Note, this file is written by cloud-init on first boot of an instance
## modifications made here will not survive a re-bundle.
## if you wish to make changes you can:
## a.) add 'apt_preserve_sources_list: true' to /etc/cloud/cloud.cfg
##     or do the same in user-data
## b.) add sources in /etc/apt/sources.list.d
## c.) make changes to template file /etc/cloud/templates/sources.list.debian.tmpl
###

# See http://www.debian.org/releases/stable/i386/release-notes/ch-upgrading.html
# for how to upgrade to newer versions of the distribution.
deb http://mirrors.cloud.aliyuncs.com/debian/ bullseye main contrib non-free
deb http://mirrors.cloud.aliyuncs.com/debian/ bullseye-updates main contrib non-free
deb http://mirrors.cloud.aliyuncs.com/debian/ bullseye-proposed-updates main non-free contrib
deb http://mirrors.cloud.aliyuncs.com/debian/ bullseye-backports main non-free contrib
## Major bug fix updates produced after the final release of the
## distribution.
deb-src http://mirrors.cloud.aliyuncs.com/debian/ bullseye-updates main contrib non-free
deb-src http://mirrors.cloud.aliyuncs.com/debian/ bullseye main contrib non-free
deb-src http://mirrors.cloud.aliyuncs.com/debian/ bullseye-proposed-updates main contrib non-free
deb-src http://mirrors.cloud.aliyuncs.com/debian/ bullseye-backports main contrib non-free

deb http://mirrors.cloud.aliyuncs.com/debian-security/ bullseye-security main non-free contrib
deb-src http://mirrors.cloud.aliyuncs.com/debian-security/ bullseye-security main non-free contrib
## Uncomment the following two lines to add software from the 'backports'
## repository.
## 
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.

debian12

deb http://mirrors.aliyun.com/debian/ bookworm main non-free-firmware
deb-src http://mirrors.aliyun.com/debian/ bookworm main non-free-firmware
deb http://mirrors.aliyun.com/debian-security bookworm-security main non-free-firmware
deb-src http://mirrors.aliyun.com/debian-security bookworm-security main non-free-firmware
deb http://mirrors.aliyun.com/debian/ bookworm-updates main non-free-firmware
deb-src http://mirrors.aliyun.com/debian/ bookworm-updates main non-free-firmware
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部