话不多说,直接上代码。将apt源设置为网易
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
执行命令:apt-get update
查阅资料时,很多都是设置阿里云的源
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
实测不行报错如下:文章来源:https://www.toymoban.com/news/detail-505999.html
错误: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: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。
更新dns,在配置文件中加入阿里巴巴提供的DNS域名解析,然而还是不行文章来源地址https://www.toymoban.com/news/detail-505999.html
sudo vim /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
nameserver 223.5.5.5
nameserver 223.6.6.
到了这里,关于debian11 设置apt源为国内的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!