这是我在 debian 11 服务器上运行 apt-get update 时得到的结果。
Err:1 http://deb.debian.org/debian bullseye InRelease Temporary failure resolving 'deb.debian.org'
Err:2 http://packages.sury.org/php bullseye InRelease Temporary failure resolving 'packages.sury.org'
Err:3 http://deb.debian.org/debian bullseye-updates InRelease Temporary failure resolving 'deb.debian.org'
Err:4 http://security.debian.org/debian-security bullseye-security InRelease Temporary failure resolving 'security deb.debian.org'
Err:5 htttp://deb.nodesource.com/node_14.x bullseye InRelease Temporary failure resolving 'deb.nodesource.com'
Err:6 http://repo.mysql.com/apt/debian buster InRelease Temporary failure resolving 'repo.mysql.com'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://deb.debian.org/debian/dists/bullseye/InRelease Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/bullseye/security InRelease Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/bullseye-updates/InRelease Temporary failure resolving 'deb.debian.org'
W: Failed to fetch
答案1
这对我有用:
echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null