Issues with apt-get update

I have a digitalocean cloud server (Ubuntu 16.04) that I have setup my ufw on. When I try to run apt-get update, I get the following:

Err:1 http://mirrors.digitalocean.com/ubuntu xenial InRelease
  Temporary failure resolving 'mirrors.digitalocean.com'
Err:2 http://mirrors.digitalocean.com/ubuntu xenial-updates InRelease
  Temporary failure resolving 'mirrors.digitalocean.com'
Err:3 http://mirrors.digitalocean.com/ubuntu xenial-backports InRelease
  Temporary failure resolving 'mirrors.digitalocean.com'
Err:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:5 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease
  Temporary failure resolving 'ppa.launchpad.net'
Reading package lists... Done
W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'mirrors.digitalocean.com'
W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/xenial-updates/InRelease  Temporary failure resolving 'mirrors.digitalocean.com'
W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/xenial-backports/InRelease  Temporary failure resolving 'mirrors.digitalocean.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.

What I've tried:

mv /var/lib/apt/lists /var/lib/apt/lists.old 
apt-get clean
apt-get update
#<= Err:1 http://mirrors.digitalocean.com/ubuntu xenial InRelease
  Temporary failure resolving 'mirrors.digitalocean.com'
Err:2 http://mirrors.digitalocean.com/ubuntu xenial-updates InRelease
  Temporary failure resolving 'mirrors.digitalocean.com'
Err:3 http://mirrors.digitalocean.com/ubuntu xenial-backports InRelease
  Temporary failure resolving 'mirrors.digitalocean.com'
Err:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:5 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease
  Temporary failure resolving 'ppa.launchpad.net'
Reading package lists... Done
W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'mirrors.digitalocean.com'
W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/xenial-updates/InRelease  Temporary failure resolving 'mirrors.digitalocean.com'
W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/xenial-backports/InRelease  Temporary failure resolving 'mirrors.digitalocean.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/dists/xenial/InRelease  Temporary failure resolving 'ppa.launchpad.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.

The output of my resolv.conf and my name servers:

cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

cat /etc/network/interfaces.d/50-cloud-init.cfg
# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
auto lo
iface lo inet loopback
    dns-nameservers 67.207.67.2 67.207.67.3

ufw has been configured to allow apt-get by allowing port 53 and port 123. Even disabling ufw produces the same results, I've been googling the problem and it seems very common, but none of the fixes for it have worked for me, does anybody know of any fixes for this issue?

0
задан 17 October 2018 в 19:53
1 ответ

Можете ли вы попробовать отладить его немного подробнее с помощью следующих команд в качестве пользователя root ?

Мой вариант заключается в том, что вы можете не переопределять DNS DO, так как они используются для разрешения зеркал. digocean.com и другие необходимые вещи (мониторинг, ntp ...).

Вы можете захотеть добавить свои собственные серверы имен (67.207.67.2 67.207.67.3) с наименьшим приоритетом, чем DO вместо их замены.

У меня сейчас нет готовой капли, чтобы проверить, но это явно намек

.
0
ответ дан 5 December 2019 в 05:12

Теги

Похожие вопросы