debian11 set apt source to domestic

  Not much to say, just go to the code. Set the apt source to Netease

cat > /etc/apt/sources.list << EOF
deb https://mirrors.163.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.163.com/debian/ bullseye main non-free contrib
deb https://mirrors.163.com/debian-security/ bullseye-security main
deb-src https://mirrors.163.com/debian-security/ bullseye-security main
deb https://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.163.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.163.com/debian/ bullseye-backports main non-free contrib
EOF

  When executing the command: apt-get update
  to check the data, many of them are the source of Alibaba Cloud

cat > /etc/apt/sources.list << EOF
deb http://mirrors.cloud.aliyuncs.com/debian/ bullseye main contrib non-free
deb-src 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-src http://mirrors.cloud.aliyuncs.com/debian/ bullseye-updates main contrib non-free

deb http://mirrors.cloud.aliyuncs.com/debian/ bullseye-backports 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/ bullseye-proposed-updates main contrib non-free
deb-src http://mirrors.cloud.aliyuncs.com/debian/ bullseye-proposed-updates main contrib non-free

deb http://mirrors.cloud.aliyuncs.com/debian-security/ bullseye-security main contrib non-free
deb-src http://mirrors.cloud.aliyuncs.com/debian-security/ bullseye-security main contrib non-free
EOF

  The actual test fails and the error is reported as follows:

错误:1 http://mirrors.cloud.aliyuncs.com/debian bullseye InRelease
  无法解析域名“mirrors.cloud.aliyuncs.com”
错误:2 http://mirrors.cloud.aliyuncs.com/debian bullseye-updates InRelease
  无法解析域名“mirrors.cloud.aliyuncs.com”
错误:3 http://mirrors.cloud.aliyuncs.com/debian bullseye-backports InRelease
  无法解析域名“mirrors.cloud.aliyuncs.com”
错误:4 http://mirrors.cloud.aliyuncs.com/debian bullseye-proposed-updates InRelease
  无法解析域名“mirrors.cloud.aliyuncs.com”
错误:5 http://mirrors.cloud.aliyuncs.com/debian-security bullseye-security InRelease
  无法解析域名“mirrors.cloud.aliyuncs.com”
正在读取软件包列表... 完成
W: 无法下载 http://mirrors.cloud.aliyuncs.com/debian/dists/bullseye/InRelease  无法解析域名“mirrors.cloud.aliyuncs.com”
W: 无法下载 http://mirrors.cloud.aliyuncs.com/debian/dists/bullseye-updates/InRelease  无法解析域名“mirrors.cloud.aliyuncs.com”
W: 无法下载 http://mirrors.cloud.aliyuncs.com/debian/dists/bullseye-backports/InRelease  无法解析域名“mirrors.cloud.aliyuncs.com”
W: 无法下载 http://mirrors.cloud.aliyuncs.com/debian/dists/bullseye-proposed-updates/InRelease  无法解析域名“mirrors.cloud.aliyuncs.com”
W: 无法下载 http://mirrors.cloud.aliyuncs.com/debian-security/dists/bullseye-security/InRelease  无法解析域名“mirrors.cloud.aliyuncs.com”
W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。

  Update dns, add the DNS domain name resolution provided by Alibaba in the configuration file, but it still doesn’t work

sudo vim  /etc/resolv.conf 
nameserver 8.8.8.8 
nameserver 8.8.4.4
nameserver 223.5.5.5
nameserver 223.6.6.

Guess you like

Origin blog.csdn.net/weixin_43839871/article/details/129613446