一、运行了一个debian容器,进入容器后执行apt-get update报错
root@nginx-demo-deployment-59fbc48594-4z8h9:/# apt-get update Err:1 http://deb.debian.org/debian buster InRelease Temporary failure resolving 'deb.debian.org' Err:2 http://security.debian.org/debian-security buster/updates InRelease Temporary failure resolving 'security.debian.org' Err:3 http://deb.debian.org/debian buster-updates InRelease Temporary failure resolving 'deb.debian.org'
二、修改源
查看当前设置源
oot@nginx-demo-deployment-59fbc48594-4z8h9:/# cat /etc/apt/sources.list # deb http://snapshot.debian.org/archive/debian/20201209T232235Z buster main deb http://deb.debian.org/debian buster main # deb http://snapshot.debian.org/archive/debian-security/20201209T232235Z buster/updates main deb http://security.debian.org/debian-security buster/updates main # deb http://snapshot.debian.org/archive/debian/20201209T232235Z buster-updates main deb http://deb.debian.org/debian buster-updates main
# deb http://snapshot.debian.org/archive/debian/20200607T000000Z buster main deb http://deb.debian.org/debian buster main # deb http://snapshot.debian.org/archive/debian-security/20200607T000000Z buster/updates main deb http://security.debian.org/debian-security buster/updates main # deb http://snapshot.debian.org/archive/debian/20200607T000000Z buster-updates main deb http://deb.debian.org/debian buster-updates main