DNS配置解决apt install “Could not resolve ‘cn.archive.ubuntu.com‘”的问题

在服务器上install东西发现一直显示fall
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/gcc-7/cpp-7_7.5.0-3ubuntu1~18.04_amd64.deb Could not resolve ‘cn.archive.ubuntu.com’
这是dns没有配导致上不了网。
解决办法:

  • vi /etc/systemd/resolved.conf 修改了DNS=114.114.114.114
  • 然后sudo apt-get update

猜你喜欢

转载自blog.csdn.net/m0_46538057/article/details/111152378