debian 国外国内可用更新源
今天DD了一台服务器
但是更新源有问题
无法apt update
尝试修改更新源似乎也没什么用
于是找了一台debian11可以更新的服务器
把他上面的/etc/apt/sources.list文件下载下来
替换到我这台有问题的服务器
然后可以正常更新了
附上sources.list文件内容
# deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 NETINST 20210814-10:07]/ bullseye main #deb cdrom:[Debian GNU/Linux 11.0.0 _Bullseye_ - Official amd64 NETINST 20210814-10:07]/ bullseye main deb http://deb.debian.org/debian/ bullseye main deb-src http://deb.debian.org/debian/ bullseye main deb http://security.debian.org/debian-security bullseye-security main deb-src http://security.debian.org/debian-security bullseye-security main # bullseye-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/ bullseye-updates main deb-src http://deb.debian.org/debian/ bullseye-updates main # 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.
反之,我们还可以换成国内源:
以下换成阿里云源
cat >/etc/apt/sources.list <<EOF deb http://mirrors.aliyun.com/debian stable main bullseye non-free deb http://mirrors.aliyun.com/debian stable-proposed-updates main bullseye non-free deb http://mirrors.aliyun.com/debian stable-updates main bullseye non-free deb-src http://mirrors.aliyun.com/debian stable main bullseye non-free deb-src http://mirrors.aliyun.com/debian stable-proposed-updates main bullseye non-free deb-src http://mirrors.aliyun.com/debian stable-updates main bullseye non-free EOF
国外源
cat >/etc/apt/sources.list <<EOF deb http://deb.debian.org/debian/ bullseye main deb-src http://deb.debian.org/debian/ bullseye main deb http://security.debian.org/debian-security bullseye-security main deb-src http://security.debian.org/debian-security bullseye-security main deb http://deb.debian.org/debian/ bullseye-updates main deb-src http://deb.debian.org/debian/ bullseye-updates main EOF
官方现成的源
cat >/etc/apt/sources.list <<EOF 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://deb.debian.org/debian-security/ bookworm-security main non-free-firmware deb-src http://deb.debian.org/debian-security/ bookworm-security main non-free-firmware 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 EOF