debian更换apt的源
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
本文来自博客园,作者:项希盛,转载请注明原文链接:https://www.cnblogs.com/xiangxisheng/p/18744028
浙公网安备 33010602011771号