Временная ошибка при разрешении security debian org

I have a Rails application that I want to deploy using Docker on an Ubuntu server. I have the Dockerfile for the application already set up, right now I want to view the nginx conf in its container.

I ran the command below to start an nginx container in an interactive mode:

docker run -i -t nginx:latest /bin/bash

Right now I am trying to install nano editor in order to view the configuration for nginx configuration (nginx.conf) using the commands below:

apt-get update
apt-get install nano
export TERM=xterm

However, when I run the first command apt-get update, I get the error below:

Err:1 http://security.debian.org/debian-security buster/updates InRelease
  Temporary failure resolving 'security.debian.org'
Err:2 http://deb.debian.org/debian buster InRelease                  
  Temporary failure resolving 'deb.debian.org'
Err:3 http://deb.debian.org/debian buster-updates InRelease
  Temporary failure resolving 'deb.debian.org'
Reading package lists... Done    
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

I have checked very well it has nothing to do with network connectivity. I would need some help. Thank you.

asked May 2, 2020 at 22:58

Promise Preston's user avatar

Promise PrestonPromise Preston

24.5k12 gold badges146 silver badges144 bronze badges

1

Try restarting Docker.

One of these should work:

sudo service docker restart
sudo /etc/init.d/docker restart
sudo snap restart docker

Even in cases where Docker never worked before, some commenters said this was helpful. However, you may have a different issue.

answered Sep 24, 2020 at 20:14

Mario Olivio Flores's user avatar

5

Perhaps the network on the VM is not communicating with the default network created by docker during the build (bridge), so try «host» network :

docker build --network host -t [image_name]

for docker-compose:

service_name:
    container_name: name
    build: 
      context: .
      network: host

Ken Aqshal's user avatar

answered Mar 19, 2021 at 20:00

manumazu's user avatar

manumazumanumazu

8015 silver badges3 bronze badges

11

If you have VPN running, stop it and try again. It solved for me!

answered Aug 14, 2020 at 15:26

Francisco Cardoso's user avatar

1

Run this command:

echo -e «nameserver 8.8.8.8\nnameserver 8.8.4.4» |sudo tee -a /etc/resolv.conf

After that run-

sudo apt-get update

This worked for me.

answered May 20, 2022 at 6:30

Md Ashikuzzaman 's user avatar

1

Here’s how I solved it:

Start the docker container for the application in an interactive mode, in my case it an nginx container :

docker run -i -t nginx:latest /bin/bash

Run the command below to grant read permission to the others role for the resolv.conf file:

chmod o+r /etc/resolv.conf

Note: If you are having this issue on your host machine (Ubuntu Linux OS) and not for the Docker containers, then run the same command adding sudo to it in the host machine terminal:

sudo chmod o+r /etc/resolv.conf

Endeavour to exit your bash interactive terminal once you run this:

exit

And then open a new bash interactive terminal and run the commands again:

apt-get update
apt-get install nano
export TERM=xterm

Everything should work fine now.

Reference to this on Digital Ocean: Apt error: Temporary failure resolving ‘deb.debian.org’

That’s all.

Asclepius's user avatar

Asclepius

58.2k17 gold badges167 silver badges144 bronze badges

answered May 2, 2020 at 22:58

Promise Preston's user avatar

Promise PrestonPromise Preston

24.5k12 gold badges146 silver badges144 bronze badges

1

sudo vi /etc/docker/daemon.json

and check flag of iptables, aslo add DNS if not added

{...., "iptables":true,"dns": ["8.8.8.8", "8.8.4.4"]}

then

sudo service docker restart

solved me

answered Apr 14, 2022 at 10:23

Victor Orletchi's user avatar

Victor OrletchiVictor Orletchi

4691 gold badge5 silver badges15 bronze badges

0

I had the same problem and in my case it was file access control.

I uses extended acls on the docker root folder and did not realize it, because they where inherited from the folder above (stupid idea to test docker in a «scratch» directory where permissions are set via extended acls).

This lead to the situation that «/etc/resolv.conf» had setting «640» inside the running docker container with a «+» marking the extended acls. But the image did not have extended acls installed and could not handle it.

The weird thing was that, as far as I can see, all other network tools worked (e.g. ping) but only apt could no access the DNS resolver.

After removing the extended acls from the docker root and setting the usual acls, everything worked inside the running container.

Similar to the answer of «Promise Prestion», but solved permanently for new containers, too.

answered Mar 25, 2021 at 14:50

Marco's user avatar

MarcoMarco

8249 silver badges13 bronze badges

1

Under Debian, as root, I’ve ran:

/etc/init.d/docker restart

This solved the issue for me.

Then build and run the container again.

sɐunıɔןɐqɐp's user avatar

sɐunıɔןɐqɐp

3,34215 gold badges36 silver badges40 bronze badges

answered Jan 27, 2021 at 19:17

JemmyX's user avatar

0

I easily resolved it via:

- docker exec -it nginx bash (Go inside container)
- ping google.com (if not working)
- exit (Exit from container)
- sudo service docker restart

Please also confirms /etc/sysctl.conf

- net.ipv4.ip_forward = 1

sudo sysctl -p /etc/sysctl.conf

answered May 3, 2020 at 4:57

Jaydip Chabhadiya's user avatar

I was having the wrong DNS IP address in my /etc/docker/daemon.json. In my case, it was my home router DNS IP address and I was trying from the office network.
I found out my office DNS and updated with that.

{ 
  "dns": ["192.168.1.1"] 
}

Eric Aya's user avatar

Eric Aya

69.5k35 gold badges181 silver badges253 bronze badges

answered Jun 29, 2022 at 17:59

shubham rasal's user avatar

1

I had a similar issue, I tried many suggested solutions, but my issue was gone after I rebooted my VM.

Asclepius's user avatar

Asclepius

58.2k17 gold badges167 silver badges144 bronze badges

answered Sep 2, 2020 at 14:30

babis21's user avatar

babis21babis21

1,5351 gold badge16 silver badges30 bronze badges

Similar issue, under debian.
Root cause was a bad DOCKER-USER rule in iptables chain

Those rules have been haded

iptables -I DOCKER-USER -i eno1 -j DROP
iptables -I DOCKER-USER -s 90.62.xxx.xx/32 -i eno1 -j ACCEPT

so removing temporarily following rule fix the point

iptables -D DOCKER-USER -i eno1 -j DROP

answered Jul 15, 2021 at 13:35

c-tools's user avatar

Coming here from some docker cross compiling headache:

While forking some repo I manually downloaded its root folder containing confd stuff and added it just like the original maintainer did.

ADD root /

after this I was not able to apt update anymore.

I found that the permission of my root named folder was wrong. stat -f "%OLp" root revealed it is 700, but must be 755 to work.

answered Oct 9, 2021 at 22:02

Max's user avatar

MaxMax

5022 gold badges4 silver badges14 bronze badges

I’m using Arch version 6.0.11 and docker version 20.10.21, and having this issues inside docker containers.

Thanks to @Marco, that was the initial hint to solve this. The problem is related to the use of extended ACLs in the host system.

The docker root folder has ACLs, you can see this as it has a plus sign at the end of permissions «+»:

$ sudo ls -lh /var/lib/docker
drw-rw-r--+    3 root root 4.0K Nov 24  2021 network

And what is the problem? Some docker images does not have ACLs installed, so as it was pointed this causes an issue.

Other network tools like curl resolved DNS properly, but apt or git have problems with DNS resolution.


TLDR; Where is the fix? Modify ACL to set default rx to others.

setfacl -R -d -m o::rx /var/lib/docker

After that, all network tools will be able to perform DNS resolution.

Credits:

Marco comment

Closed git issue in docker

Antoine's user avatar

Antoine

1,3934 gold badges20 silver badges26 bronze badges

answered Dec 11, 2022 at 18:55

A.Rodriguez's user avatar

The answer from @Mario Olivio Flores suggests using the service command. That is correct and probably works currently on all Linux distributions. However, as most Linux distributions prefer systemd over systemV, it seems better to use just that with the following command:

sudo systemctl restart docker

For example, on my Linux distribution the service script located at /usr/sbin/service just wraps systemctl, see this excerpt:

# When this machine is running systemd, standard service calls are turned into
# systemctl calls.
if [ -n "$is_systemd" ]
then
   UNIT="${SERVICE%.sh}.service"

   case "${ACTION}" in
      restart|status|try-restart)
         exec systemctl $sctl_args ${ACTION} ${UNIT}
      ;;

answered Feb 27 at 12:06

flyingdutchman's user avatar

For me, it turned out to be a random WSL 2 issue — running wsl --shutdown and restarting the containers solved it for me.

answered Mar 27 at 14:22

Michał Zawadzki's user avatar

It used to work before, then I got the same error. I’ve had a Debian and a Docker update in the meantime however. And I’ve found, that the latest Docker on debian/bookworm has this /etc/docker/daemon.json config:

{
     "bridge": "none"
}

Changing "none" to "" followed by the command systemctl docker restart solved my problem. Seems like it uses the default bridge that I have had before, you may have to create it.

answered Aug 10 at 21:33

Zoltan Peller's user avatar

Перейти к контенту

Всем привет!
В общем недавно появилась такая проблема, имеется несколько серверов на debain 9, и не один из них не пингует домены ни ya.ru, ни deb.debain.org соответственно ни скачать, ни обновить пакеты я не могу.
Предыстория: Есть сервер на windows server 2016 standart на котором развернута hyper-v, внутри которого работают 4 сервера под deban 9, 1 на CentOS 7, 1 openwrt который соответственно и раздает интернет всему, что есть вообще в локальной сети.
На debain крутятся сервера с 1-jabber, 2-open-vpn, 3-icecast, 4-ut99, которые как были настроены так и забыты, с периодичностью обновления пакетов (apt updateupgrade)в какой-то момент заметил что нет соединения до репозитория deb.debain.org а так же squrity и т.д.

root@icecast2:/home/esmertec# apt update
Ошк:1 http://security.debian.org/debian-security stretch/updates InRelease
  Временная ошибка при попытке получить IP-адрес «security.debian.org»
Ошк:2 http://deb.debian.org/debian stretch InRelease
  Временная ошибка при попытке получить IP-адрес «deb.debian.org»
Ошк:3 http://deb.debian.org/debian stretch-updates InRelease
  Временная ошибка при попытке получить IP-адрес «deb.debian.org»
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Все пакеты имеют последние версии.
W: Не удалось получить http://deb.debian.org/debian/dists/stretch/InRelease  Временная ошибка при попытке получить IP-адрес «deb.debian.org»
W: Не удалось получить http://security.debian.org/debian-security/dists/stretch/updates/InRelease  Временная ошибка при попытке получить IP-адрес «security.debian.org»
W: Не удалось получить http://deb.debian.org/debian/dists/stretch-updates/InRelease  Временная ошибка при попытке получить IP-адрес «deb.debian.org»
W: Некоторые индексные файлы не скачались. Они были проигнорированы или вместо них были использованы старые версии.
root@icecast2:/home/esmertec#

Но самое смешное что интернет им предоставляется, т.е. icecast2 свободно стримит музыку «в мир», к джабберу можно подключиться и т.д.
Подскажите в чем может быть проблема? IP прописаны статически, конфликтов нет, dns так же прописаны верно, sources list не изменялся
P.S. CentOS 7 в сети чувствует себя отлично, т.е. его эта проблема не касается ни как, все работает штатно, на самом win сервере так же все отлично работает….

У меня есть приложение Rails , которое я хочу развернуть с помощью Docker на сервере Ubuntu . У меня уже настроен Dockerfile для приложения, сейчас я хочу просмотреть conf nginx в его контейнере.

Я запустил команду ниже, чтобы запустить контейнер nginx в интерактивном режиме:

docker run -i -t nginx:latest /bin/bash

Сейчас я пытаюсь установить редактор nano, чтобы просмотреть конфигурацию для nginx конфигурации (nginx.conf), используя следующие команды:

apt-get update
apt-get install nano
export TERM=xterm

Однако когда я запускаю первую команду apt-get update, я получаю сообщение об ошибке ниже:

Err:1 http://security.debian.org/debian-security buster/updates InRelease
  Temporary failure resolving 'security.debian.org'
Err:2 http://deb.debian.org/debian buster InRelease                  
  Temporary failure resolving 'deb.debian.org'
Err:3 http://deb.debian.org/debian buster-updates InRelease
  Temporary failure resolving 'deb.debian.org'
Reading package lists... Done    
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

Я очень хорошо проверил, это не имеет ничего общего с сетевым подключением. Мне нужна помощь. Спасибо.

2 ответа

Я легко решил это с помощью .

- docker exec -it nginx bash (Go inside container)
- ping google.com (if not working)
- exit (Exit from container)
- sudo service docker restart

Пожалуйста, подтвердите также /etc/sysctl.conf

- net.ipv4.ip_forward = 1

sudo sysctl -p /etc/sysctl.conf


0

Jaydip Chabhadiya
3 Май 2020 в 04:57

Вот как я это решил :

Запустите Docker-контейнер для приложения в интерактивном режиме, в моем случае это контейнер nginx:

docker run -i -t nginx:latest /bin/bash

Выполните команду ниже, чтобы предоставить read разрешение роли others для файла resolv.conf:

chmod o+r /etc/resolv.conf

Примечание . Если эта проблема возникает на вашем хост-компьютере (ОС Ubuntu Linux), а не на контейнерах Docker, выполните ту же команду, добавив sudo к ней в терминале хост-машины:

sudo chmod o+r /etc/resolv.conf

Постарайтесь выйти из интерактивного терминала bash после запуска этого:

exit

А затем откройте новый интерактивный терминал bash и снова запустите команды:

apt-get update
apt-get install nano
export TERM=xterm

Теперь все должно работать нормально.

Ссылка на это в Цифровом океане: Apt ошибка: временная ошибка при разрешении deb.debian.org

Вот и все.

Надеюсь, это поможет


0

Promise Preston
2 Май 2020 в 22:58

So I denied everything except DNS, HTTPS and HTTP in the gufw firewall. ufw status verbose looks good with no DENY for port 53 and only allows at the bottom of it. I even executed sudo ufw allow 53/udp and also tried setting the DNS nameserver to 8.8.8.8. Still it doesn’t work: apt-get update gives me «Temporary failure resolving ‘security.debian.org’». Pings don’t work either.

In /var/log/syslog it also says:

WARNING: Can’t read main.cvd header from db.local.clamav.net (IP: )
WARNING: Can’t query current.cvd.clamav.net
WARNING: Invalid DNS reply. Falling back to HTTP mode.
Reading CVD header (main.cvd): ERROR: Can’t get information about database.clamav.net: Temporary failure in name resolution.

and

Activating service name=’org.kde.powerdevil.backlighthelper’ (using servicehelper)

avahi-daemon is set to DENY in case that matters.
Also a ClamAV scan found the same as listed in my question here

It worked earlier using iptables which basically had the same rules for DNS.

I’m running a freshly installed Debian 9.1 with KDE.

Any ideas what might be causing this? How can I get it working?

So I denied everything except DNS, HTTPS and HTTP in the gufw firewall. ufw status verbose looks good with no DENY for port 53 and only allows at the bottom of it. I even executed sudo ufw allow 53/udp and also tried setting the DNS nameserver to 8.8.8.8. Still it doesn’t work: apt-get update gives me «Temporary failure resolving ‘security.debian.org’». Pings don’t work either.

In /var/log/syslog it also says:

WARNING: Can’t read main.cvd header from db.local.clamav.net (IP: )
WARNING: Can’t query current.cvd.clamav.net
WARNING: Invalid DNS reply. Falling back to HTTP mode.
Reading CVD header (main.cvd): ERROR: Can’t get information about database.clamav.net: Temporary failure in name resolution.

and

Activating service name=’org.kde.powerdevil.backlighthelper’ (using servicehelper)

avahi-daemon is set to DENY in case that matters.
Also a ClamAV scan found the same as listed in my question here

It worked earlier using iptables which basically had the same rules for DNS.

I’m running a freshly installed Debian 9.1 with KDE.

Any ideas what might be causing this? How can I get it working?

I installed debian 11 Bullseye and here is my source.list file:

deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free

deb http://security.debian.org/debian-security bullseye-security main contrib non-free
deb-src http://security.debian.org/debian-security bullseye-security main contrib non-free

deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free

deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free

While I try to update with apt update, here are the errors I get:

Err:1 http://deb.debian.org/debian bullseye InRelease
Could not resolve 'deb.debian.org'
Err:2 http://security.debian.org.debian-security bullseye InRelease
Could not resolve 'deb.debian.org'
Err:3 http://deb.debian.org/debian bullseye-updates InRelease
Could not resolve 'deb.debian.org'
Err:4 http://security.debian.org.debian bullseye-backports InRelease
Could not resolve 'deb.debian.org'
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 Could not resolve 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/bullseye-security/InRelease Could not resolve 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/bullseye-updates/InRelease Could not resolve 'deb.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/bullseye-backports/InRelease Could not resolve 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

What is wrong with my source.list file? Is there anything else to set up?

I have a Rails application that I want to deploy using Docker on an Ubuntu server. I have the Dockerfile for the application already set up, right now I want to view the nginx conf in its container.

I ran the command below to start an nginx container in an interactive mode:

docker run -i -t nginx:latest /bin/bash

Right now I am trying to install nano editor in order to view the configuration for nginx configuration (nginx.conf) using the commands below:

apt-get update
apt-get install nano
export TERM=xterm

However, when I run the first command apt-get update, I get the error below:

Err:1 http://security.debian.org/debian-security buster/updates InRelease
  Temporary failure resolving 'security.debian.org'
Err:2 http://deb.debian.org/debian buster InRelease                  
  Temporary failure resolving 'deb.debian.org'
Err:3 http://deb.debian.org/debian buster-updates InRelease
  Temporary failure resolving 'deb.debian.org'
Reading package lists... Done    
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

I have checked very well it has nothing to do with network connectivity. I would need some help. Thank you.

asked May 2, 2020 at 22:58

Promise Preston's user avatar

Promise PrestonPromise Preston

20.8k11 gold badges125 silver badges128 bronze badges

1

Try restarting docker. Worked for me.

sudo service docker restart or sudo /etc/init.d/docker restart

Prior to bumping into this issue, docker was working fine. If you never had docker working in the first place, you probably have a different issue.

answered Sep 24, 2020 at 20:14

Mario Olivio Flores's user avatar

4

Perhaps the network on the VM is not communicating with the default network created by docker during the build (bridge), so try «host» network :

docker build --network host -t [image_name]

answered Mar 19, 2021 at 20:00

manumazu's user avatar

manumazumanumazu

6034 silver badges2 bronze badges

6

If you have VPN running, stop it and try again. It solved for me!

answered Aug 14, 2020 at 15:26

Francisco Cardoso's user avatar

1

Here’s how I solved it:

Start the docker container for the application in an interactive mode, in my case it an nginx container :

docker run -i -t nginx:latest /bin/bash

Run the command below to grant read permission to the others role for the resolv.conf file:

chmod o+r /etc/resolv.conf

Note: If you are having this issue on your host machine (Ubuntu Linux OS) and not for the Docker containers, then run the same command adding sudo to it in the host machine terminal:

sudo chmod o+r /etc/resolv.conf

Endeavour to exit your bash interactive terminal once you run this:

exit

And then open a new bash interactive terminal and run the commands again:

apt-get update
apt-get install nano
export TERM=xterm

Everything should work fine now.

Reference to this on Digital Ocean: Apt error: Temporary failure resolving ‘deb.debian.org’

That’s all.

Asclepius's user avatar

Asclepius

54.3k16 gold badges156 silver badges139 bronze badges

answered May 2, 2020 at 22:58

Promise Preston's user avatar

Promise PrestonPromise Preston

20.8k11 gold badges125 silver badges128 bronze badges

1

sudo vi /etc/docker/daemon.json

and check flag of iptables, aslo add DNS if not added

{...., "iptables":true,"dns": ["8.8.8.8", "8.8.4.4"]}

then

sudo service docker restart

solved me

answered Apr 14, 2022 at 10:23

Victor Orletchi's user avatar

Victor OrletchiVictor Orletchi

4211 gold badge4 silver badges14 bronze badges

I had the same problem and in my case it was file access control.

I uses extended acls on the docker root folder and did not realize it, because they where inherited from the folder above (stupid idea to test docker in a «scratch» directory where permissions are set via extended acls).

This lead to the situation that «/etc/resolv.conf» had setting «640» inside the running docker container with a «+» marking the extended acls. But the image did not have extended acls installed and could not handle it.

The weird thing was that, as far as I can see, all other network tools worked (e.g. ping) but only apt could no access the DNS resolver.

After removing the extended acls from the docker root and setting the usual acls, everything worked inside the running container.

Similar to the answer of «Promise Prestion», but solved permanently for new containers, too.

answered Mar 25, 2021 at 14:50

Marco's user avatar

MarcoMarco

7496 silver badges11 bronze badges

0

Run this command:

echo -e «nameserver 8.8.8.8nnameserver 8.8.4.4» |sudo tee -a /etc/resolv.conf

After that run-

sudo apt-get update

This worked for me.

answered May 20, 2022 at 6:30

Md Ashikuzzaman's user avatar

1

I easily resolved it via:

- docker exec -it nginx bash (Go inside container)
- ping google.com (if not working)
- exit (Exit from container)
- sudo service docker restart

Please also confirms /etc/sysctl.conf

- net.ipv4.ip_forward = 1

sudo sysctl -p /etc/sysctl.conf

answered May 3, 2020 at 4:57

Jaydip Chabhadiya's user avatar

Under Debian, as root, I’ve ran:

/etc/init.d/docker restart

This solved the issue for me.

Then build and run the container again.

sɐunıɔןɐqɐp's user avatar

sɐunıɔןɐqɐp

3,11915 gold badges34 silver badges39 bronze badges

answered Jan 27, 2021 at 19:17

JemmyX's user avatar

I was having the wrong DNS IP address in my /etc/docker/daemon.json. In my case, it was my home router DNS IP address and I was trying from the office network.
I found out my office DNS and updated with that.

{ 
  "dns": ["192.168.1.1"] 
}

Eric Aya's user avatar

Eric Aya

69k35 gold badges179 silver badges250 bronze badges

answered Jun 29, 2022 at 17:59

shubham rasal's user avatar

1

Similar issue, under debian.
Root cause was a bad DOCKER-USER rule in iptables chain

Those rules have been haded

iptables -I DOCKER-USER -i eno1 -j DROP
iptables -I DOCKER-USER -s 90.62.xxx.xx/32 -i eno1 -j ACCEPT

so removing temporarily following rule fix the point

iptables -D DOCKER-USER -i eno1 -j DROP

answered Jul 15, 2021 at 13:35

c-tools's user avatar

Coming here from some docker cross compiling headache:

While forking some repo I manually downloaded its root folder containing confd stuff and added it just like the original maintainer did.

ADD root /

after this I was not able to apt update anymore.

I found that the permission of my root named folder was wrong. stat -f "%OLp" root revealed it is 700, but must be 755 to work.

answered Oct 9, 2021 at 22:02

Max's user avatar

MaxMax

4822 gold badges4 silver badges14 bronze badges

I had a similar issue, I tried many suggested solutions, but my issue was gone after I rebooted my VM.

Asclepius's user avatar

Asclepius

54.3k16 gold badges156 silver badges139 bronze badges

answered Sep 2, 2020 at 14:30

babis21's user avatar

babis21babis21

1,2651 gold badge15 silver badges27 bronze badges

I’m using Arch version 6.0.11 and docker version 20.10.21, and having this issues inside docker containers.

Thanks to @Marco, that was the initial hint to solve this. The problem is related to the use of extended ACLs in the host system.

The docker root folder has ACLs, you can see this as it has a plus sign at the end of permissions «+»:

$ sudo ls -lh /var/lib/docker
drw-rw-r--+    3 root root 4.0K Nov 24  2021 network

And what is the problem? Some docker images does not have ACLs installed, so as it was pointed this causes an issue.

Other network tools like curl resolved DNS properly, but apt or git have problems with DNS resolution.


TLDR; Where is the fix? Modify ACL to set default rx to others.

setfacl -R -d -m o::rx /var/lib/docker

After that, all network tools will be able to perform DNS resolution.

Credits:

Marco comment

Closed git issue in docker

Antoine's user avatar

Antoine

1,3674 gold badges20 silver badges26 bronze badges

answered Dec 11, 2022 at 18:55

A.Rodriguez's user avatar

  • Печать

Страницы: [1]   Вниз

Тема: Новичёк Debian: apt-get update — Не нашёл IP  (Прочитано 5243 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
Petro78


Оффлайн
Quixotic


Оффлайн
Petro78

там форум «менее живой»


Пользователь решил продолжить мысль 21 Февраля 2011, 10:54:52:


нужен Tomcat из репозитария и JDK6

« Последнее редактирование: 21 Февраля 2011, 10:54:52 от Petro78 »


Оффлайн
easy2002

Tempora mutantur et nos mutantur in illis


Оффлайн
Petro78

3 строки нарыл в инете.
Мне нужен лист для минимальной конфигурации (у прова стоит Debian6 mini)
Т.е. можно оставить 1 строку для безопасности и потом добавить для томката и java
PS/
Сеть на статичных IP сделал, но всё равно ошибка


Оффлайн
лесной_зонтик

Моя мечта поставить на комп Linux, Unix, *BSD, Mac OS X, OpenSolaris, OS/2, Windows.
Не спрашивайте зачем. Сам не знаю ???


Оффлайн
Petro78


Оффлайн
easy2002

deb http://ftp.ru.debian.org/debian/ squeeze main contrib non-free
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb http://ftp.ru.debian.org/debian/ squeeze-proposed-updates main contrib non-free

Tempora mutantur et nos mutantur in illis


Оффлайн
Petro78

deb http://ftp.ru.debian.org/debian/ squeeze main contrib non-free
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb http://ftp.ru.debian.org/debian/ squeeze-proposed-updates main contrib non-free

# apt-get update
Ош  http://ftp.ru.debian.org squeeze Release.gpg                                           
  Не удалось найти IP адрес для ftp.ru.debian.org
тут, может у меня с dnshosts… что не так?


Пользователь решил продолжить мысль 21 Февраля 2011, 15:05:55:


спс за ссылки.
Заработало (часть проблем было из за нестабильного выхода в инет)
Java поставил так:
apt-get install sun-java6-jre

« Последнее редактирование: 21 Февраля 2011, 15:05:55 от Petro78 »


  • Печать

Страницы: [1]   Вверх

I have a Rails application that I want to deploy using Docker on an Ubuntu server. I have the Dockerfile for the application already set up, right now I want to view the nginx conf in its container.

I ran the command below to start an nginx container in an interactive mode:

docker run -i -t nginx:latest /bin/bash

Right now I am trying to install nano editor in order to view the configuration for nginx configuration (nginx.conf) using the commands below:

apt-get update
apt-get install nano
export TERM=xterm

However, when I run the first command apt-get update, I get the error below:

Err:1 http://security.debian.org/debian-security buster/updates InRelease
  Temporary failure resolving 'security.debian.org'
Err:2 http://deb.debian.org/debian buster InRelease                  
  Temporary failure resolving 'deb.debian.org'
Err:3 http://deb.debian.org/debian buster-updates InRelease
  Temporary failure resolving 'deb.debian.org'
Reading package lists... Done    
W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.

I have checked very well it has nothing to do with network connectivity. I would need some help. Thank you.

asked May 2, 2020 at 22:58

Promise Preston's user avatar

Promise PrestonPromise Preston

23.2k12 gold badges138 silver badges140 bronze badges

1

Try restarting Docker.

One of these should work:

sudo service docker restart
sudo /etc/init.d/docker restart
sudo snap restart docker

Even in cases where Docker never worked before, some commenters said this was helpful. However, you may have a different issue.

answered Sep 24, 2020 at 20:14

Mario Olivio Flores's user avatar

5

Perhaps the network on the VM is not communicating with the default network created by docker during the build (bridge), so try «host» network :

docker build --network host -t [image_name]

for docker-compose:

service_name:
    container_name: name
    build: 
      context: .
      network: host

Ken Aqshal's user avatar

answered Mar 19, 2021 at 20:00

manumazu's user avatar

manumazumanumazu

7634 silver badges2 bronze badges

11

If you have VPN running, stop it and try again. It solved for me!

answered Aug 14, 2020 at 15:26

Francisco Cardoso's user avatar

1

Here’s how I solved it:

Start the docker container for the application in an interactive mode, in my case it an nginx container :

docker run -i -t nginx:latest /bin/bash

Run the command below to grant read permission to the others role for the resolv.conf file:

chmod o+r /etc/resolv.conf

Note: If you are having this issue on your host machine (Ubuntu Linux OS) and not for the Docker containers, then run the same command adding sudo to it in the host machine terminal:

sudo chmod o+r /etc/resolv.conf

Endeavour to exit your bash interactive terminal once you run this:

exit

And then open a new bash interactive terminal and run the commands again:

apt-get update
apt-get install nano
export TERM=xterm

Everything should work fine now.

Reference to this on Digital Ocean: Apt error: Temporary failure resolving ‘deb.debian.org’

That’s all.

Asclepius's user avatar

Asclepius

56.9k17 gold badges165 silver badges142 bronze badges

answered May 2, 2020 at 22:58

Promise Preston's user avatar

Promise PrestonPromise Preston

23.2k12 gold badges138 silver badges140 bronze badges

1

sudo vi /etc/docker/daemon.json

and check flag of iptables, aslo add DNS if not added

{...., "iptables":true,"dns": ["8.8.8.8", "8.8.4.4"]}

then

sudo service docker restart

solved me

answered Apr 14, 2022 at 10:23

Victor Orletchi's user avatar

Victor OrletchiVictor Orletchi

4591 gold badge4 silver badges15 bronze badges

0

Run this command:

echo -e «nameserver 8.8.8.8nnameserver 8.8.4.4» |sudo tee -a /etc/resolv.conf

After that run-

sudo apt-get update

This worked for me.

answered May 20, 2022 at 6:30

Md Ashikuzzaman 's user avatar

1

I had the same problem and in my case it was file access control.

I uses extended acls on the docker root folder and did not realize it, because they where inherited from the folder above (stupid idea to test docker in a «scratch» directory where permissions are set via extended acls).

This lead to the situation that «/etc/resolv.conf» had setting «640» inside the running docker container with a «+» marking the extended acls. But the image did not have extended acls installed and could not handle it.

The weird thing was that, as far as I can see, all other network tools worked (e.g. ping) but only apt could no access the DNS resolver.

After removing the extended acls from the docker root and setting the usual acls, everything worked inside the running container.

Similar to the answer of «Promise Prestion», but solved permanently for new containers, too.

answered Mar 25, 2021 at 14:50

Marco's user avatar

MarcoMarco

8249 silver badges13 bronze badges

1

Under Debian, as root, I’ve ran:

/etc/init.d/docker restart

This solved the issue for me.

Then build and run the container again.

sɐunıɔןɐqɐp's user avatar

sɐunıɔןɐqɐp

3,26215 gold badges34 silver badges40 bronze badges

answered Jan 27, 2021 at 19:17

JemmyX's user avatar

0

I easily resolved it via:

- docker exec -it nginx bash (Go inside container)
- ping google.com (if not working)
- exit (Exit from container)
- sudo service docker restart

Please also confirms /etc/sysctl.conf

- net.ipv4.ip_forward = 1

sudo sysctl -p /etc/sysctl.conf

answered May 3, 2020 at 4:57

Jaydip Chabhadiya's user avatar

I was having the wrong DNS IP address in my /etc/docker/daemon.json. In my case, it was my home router DNS IP address and I was trying from the office network.
I found out my office DNS and updated with that.

{ 
  "dns": ["192.168.1.1"] 
}

Eric Aya's user avatar

Eric Aya

69.4k35 gold badges181 silver badges252 bronze badges

answered Jun 29, 2022 at 17:59

shubham rasal's user avatar

1

I had a similar issue, I tried many suggested solutions, but my issue was gone after I rebooted my VM.

Asclepius's user avatar

Asclepius

56.9k17 gold badges165 silver badges142 bronze badges

answered Sep 2, 2020 at 14:30

babis21's user avatar

babis21babis21

1,4451 gold badge16 silver badges29 bronze badges

Similar issue, under debian.
Root cause was a bad DOCKER-USER rule in iptables chain

Those rules have been haded

iptables -I DOCKER-USER -i eno1 -j DROP
iptables -I DOCKER-USER -s 90.62.xxx.xx/32 -i eno1 -j ACCEPT

so removing temporarily following rule fix the point

iptables -D DOCKER-USER -i eno1 -j DROP

answered Jul 15, 2021 at 13:35

c-tools's user avatar

Coming here from some docker cross compiling headache:

While forking some repo I manually downloaded its root folder containing confd stuff and added it just like the original maintainer did.

ADD root /

after this I was not able to apt update anymore.

I found that the permission of my root named folder was wrong. stat -f "%OLp" root revealed it is 700, but must be 755 to work.

answered Oct 9, 2021 at 22:02

Max's user avatar

MaxMax

5022 gold badges4 silver badges14 bronze badges

I’m using Arch version 6.0.11 and docker version 20.10.21, and having this issues inside docker containers.

Thanks to @Marco, that was the initial hint to solve this. The problem is related to the use of extended ACLs in the host system.

The docker root folder has ACLs, you can see this as it has a plus sign at the end of permissions «+»:

$ sudo ls -lh /var/lib/docker
drw-rw-r--+    3 root root 4.0K Nov 24  2021 network

And what is the problem? Some docker images does not have ACLs installed, so as it was pointed this causes an issue.

Other network tools like curl resolved DNS properly, but apt or git have problems with DNS resolution.


TLDR; Where is the fix? Modify ACL to set default rx to others.

setfacl -R -d -m o::rx /var/lib/docker

After that, all network tools will be able to perform DNS resolution.

Credits:

Marco comment

Closed git issue in docker

Antoine's user avatar

Antoine

1,3954 gold badges20 silver badges26 bronze badges

answered Dec 11, 2022 at 18:55

A.Rodriguez's user avatar

The answer from @Mario Olivio Flores suggests using the service command. That is correct and probably works currently on all Linux distributions. However, as most Linux distributions prefer systemd over systemV, it seems better to use just that with the following command:

sudo systemctl restart docker

For example, on my Linux distribution the service script located at /usr/sbin/service just wraps systemctl, see this excerpt:

# When this machine is running systemd, standard service calls are turned into
# systemctl calls.
if [ -n "$is_systemd" ]
then
   UNIT="${SERVICE%.sh}.service"

   case "${ACTION}" in
      restart|status|try-restart)
         exec systemctl $sctl_args ${ACTION} ${UNIT}
      ;;

answered Feb 27 at 12:06

flyingdutchman's user avatar

For me, it turned out to be a random WSL 2 issue — running wsl --shutdown and restarting the containers solved it for me.

answered Mar 27 at 14:22

Michał Zawadzki's user avatar

⁡.⁡а если делается, то ⁡и все в этом ⁡⁢
⁡все в порядке(или нет?), ⁡⁢
⁡надо же, нашёл⁡⁢
⁡После простоя пару месяцев, ⁡⁢
5ff7fcfa47ab9490079601.bin

⁡dpkg —purge —force-remove-reinstreq apache2.2-common⁡⁢ ⁡dpkg-reconfigure apache2.2-common⁡⁢

Ответы:

    ⁡ValeriyaWork ⁡⁢qna.habr.com⁡Началось как мне кажется ⁡⁢

    Debian 11 — Известные ошибки

    • Проблемы безопасности
    • Редакции выпусков
    • Система установки

    Проблемы безопасности

    ⁡upgrade.⁡на всех зеркалах Debian.⁡Исправления выпущенного стабильного дистрибутива ⁡выпущена ⁡update и затем apt ⁡bullseye, смотрите на ⁡Источник: ⁡⁢⁡Хотела установить Chromium. Вышлв ⁡⁢⁡как?⁡⁢

    ⁡духе, собственно вопрос, как ⁡он показывает результат и ⁡в /etc/environment была строка ⁡загрузил debian 10. При ⁡⁢

    deb http://security.debian.org/debian-security bullseye-security main contrib non-free
    

    ⁡apt-get install apache2
    ⁡или⁡2015-05-27 21:11:19⁡⁢

    Редакции выпусков

    ⁡это после неудачной установки ⁡Информацию об известных ошибках ⁡Если для обновления пакетов ⁡часто должны пройти усиленное ⁡9 октября 2021 года⁡⁢

    • ⁡upgrade.⁡страницах безопасности⁡⁢⁡.⁡⁢⁡такая ошибка, и на ⁡⁢

    ⁡akgndkut ⁡узнать. что интернет точно ⁡не выдает ошибку, так ⁡⁢⁡http_proxy=⁡⁢⁡обновлении Synaptic показал ошибку:
    ⁡⁢

    ⁡mureevms⁡apt-get purge apache2.2-common⁡shaivam⁡redmine через команду
    ⁡и обновлениях в системе ⁡вы используете APT, то ⁡тестирование, прежде чем они ⁡⁢⁡.⁡⁢ ⁡Иногда, в случаях множества ⁡⁢

    ⁡.⁡Команда безопасности Debian выпускает ⁡все команды так пишет.
    ⁡2016-05-20 01:48:42⁡подключен в debian и ⁡⁢

    # предлагаемые дополнения для редакции 11-ого выпуска
    deb http://ftp.us.debian.org/debian bullseye-proposed-updates main contrib non-free
    

    ⁡же с гуглом или ⁡localhost:9080⁡Спасибо за помощь.⁡⁢

    Система установки

    ⁡2015-05-28 06:17:53⁡apt-get install apache2.2-common
    ⁡2015-05-27 22:06:36⁡⁢⁡Второй день не могу ⁡⁢⁡установки смотрите на страницах ⁡⁢

    ⁡можете установить предлагаемые обновления, ⁡⁢debian.org⁡будут помещены в архив. ⁡⁢

    Как разрешить проблему зависимостей в debian?

    # apt-get -f install
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
    libcurl3-nss libnspr4 libnspr4-dev libnss3 libnss3-dev
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 103 not upgraded.
    3 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Setting up apache2.2-common (2.2.22-13+deb7u4) ...
    insserv: warning: script 'celery' missing LSB tags and overrides
    insserv: There is a loop between service monit and celery if stopped
    insserv:  loop involving service celery at depth 2
    insserv:  loop involving service monit at depth 1
    insserv: Stopping celery depends on monit and therefore on system facility `$all' which can not be true!
    insserv: exiting now without changing boot order!
    update-rc.d: error: insserv rejected the script header
    dpkg: error processing apache2.2-common (--configure):
    subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of apache2-mpm-itk:
    apache2-mpm-itk depends on apache2.2-common (= 2.2.22-13+deb7u4); however:
    Package apache2.2-common is not configured yet.
    dpkg: error processing apache2-mpm-itk (--configure):
    dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of apache2-threaded-dev:
    apache2-threaded-dev depends on apache2.2-common (= 2.2.22-13+deb7u4); however:
    Package apache2.2-common is not configured yet.
    dpkg: error processing apache2-threaded-dev (--configure):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    apache2.2-common
    apache2-mpm-itk
    apache2-threaded-dev
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    ⁡Подробную информацию об изменениях ⁡критических проблем или обновлений ⁡Если вы используете APT, ⁡⁢
    apt-get install redmine

    ⁡обновления пакетов в стабильном ⁡Не удалось разрешить «deb.debian.o
    ⁡bigton⁡⁢
    ⁡если при подключении в ⁡айпи провайдера, но после ⁡⁢

    # apt-get install libaprutil1-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    libaprutil1-dev is already the newest version.
    The following packages were automatically installed and are no longer required:
    libcurl3-nss libnspr4 libnspr4-dev libnss3 libnss3-dev
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 103 not upgraded.
    3 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    Setting up apache2.2-common (2.2.22-13+deb7u4) ...
    insserv: warning: script 'celery' missing LSB tags and overrides
    insserv: There is a loop between service monit and celery if stopped
    insserv:  loop involving service celery at depth 2
    insserv:  loop involving service monit at depth 1
    insserv: Stopping celery depends on monit and therefore on system facility `$all' which can not be true!
    insserv: exiting now without changing boot order!
    update-rc.d: error: insserv rejected the script header
    dpkg: error processing apache2.2-common (--configure):
    subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of apache2-mpm-itk:
    apache2-mpm-itk depends on apache2.2-common (= 2.2.22-13+deb7u4); however:
    Package apache2.2-common is not configured yet.
    dpkg: error processing apache2-mpm-itk (--configure):
    dependency problems - leaving unconfigured
    dpkg: dependency problems prevent configuration of apache2-threaded-dev:
    apache2-threaded-dev depends on apache2.2-common (= 2.2.22-13+deb7u4); however:
    Package apache2.2-common is not configured yet.
    dpkg: error processing apache2-threaded-dev (--configure):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    apache2.2-common
    apache2-mpm-itk
    apache2-threaded-dev
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    ⁡Источник: ⁡⁢ ⁡doitagain ⁡⁢

    Ответы:

    1. ⁡Попробуйте ⁡⁢ ⁡shaivam⁡⁢
      ⁡обычно подобный пост нужно ⁡найти решения, в администрировании ⁡⁢
      ⁡системы установки⁡⁢

      ⁡добавив следующую строку в ⁡⁢
      ⁡Тем не менее, эти ⁡⁢
      ⁡между версиями 11 и ⁡⁢
      ⁡безопасности, выпущенный дистрибутив обновляется. ⁡⁢
      ⁡добавьте следующую строку в ⁡⁢

      Комментарии:

    2. ⁡2020-12-05 01:13:43⁡⁢ ⁡это решение⁡⁢
      ⁡2015-05-27 23:18:07⁡⁢⁡сопровождать sources.list.⁡⁢

    ⁡серверов новичек
    ⁡⁢qna.habr.com⁡.⁡⁢

    Как исправить synaptic в debian 10 buster?

    ⁡файл /etc/apt/sources.list:⁡исправления уже доступны в ⁡11.1 смотрите в ⁡⁢

    Невозможно получить все индексы репозитория
    Возможно репозиторий больше не доступен или к нему нет доступа из-за сетевых проблем. Будет использована старая версия индекса, если она имеется. В противном случае репозиторий будет игнорирован. Проверьте сетевое соединение и правильность написания адреса репозитория в настройках.
    Не удалось получить http://mirror.mephi.ru/debian/dists/buster/InRelease  Не удалось соединиться с localhost:9080 (::1). - connect (111: В соединении отказано) Не удалось соединиться с localhost:9080 (127.0.0.1). - connect (111: В соединении отказано)Не удалось получить http://security.debian.org/debian-security/dists/buster/updates/InRelease  Не удалось соединиться с localhost:9080 (::1). - connect (111: В соединении отказано) Не удалось соединиться с localhost:9080 (127.0.0.1). - connect (111: В соединении отказано)Не удалось получить http://mirror.mephi.ru/debian/dists/buster-updates/InRelease  Невозможно соединиться с localhost:9080:Не удалось получить https://deb.torproject.org/torproject.org/dists/buster/InRelease  Не удалось соединиться с localhost:9080 (::1). - connect (111: В соединении отказано) Не удалось соединиться с localhost:9080 (127.0.0.1). - connect (111: В соединении отказано)Не удалось получить http://ftp.debian.org/debian/dists/buster/InRelease  Не удалось соединиться с localhost:9080 (::1). - connect (111: В соединении отказано) Не удалось соединиться с localhost:9080 (127.0.0.1). - connect (111: В соединении отказано)Не удалось получить http://ftp.debian.org/debian/dists/buster-updates/InRelease  Невозможно соединиться с localhost:9080:Не удалось получить http://security.debian.org/dists/buster/updates/InRelease  Невозможно соединиться с localhost:9080:Не удалось получить http://ftp.debian.org/debian/dists/buster-backports/InRelease  Невозможно соединиться с localhost:9080:Некоторые индексные файлы скачать не удалось. Они были проигнорированы, или вместо них были использованы старые версии.

    ⁡Обычно эти выпуски обозначаются ⁡⁢

    ⁡/etc/apt/sources.list, чтобы получить доступ ⁡⁢ ⁡обнаружили проблемы, относящиеся к ⁡⁢

    Ответы:

    1. ⁡rg»
      ⁡⁢
      ⁡Может быть что-то с ⁡⁢
      ⁡вводить логин и пароль, ⁡⁢

      ⁡в sources.list адреса до ⁡Если пинговать ip серверов ⁡⁢⁡doitagain Автор вопроса⁡⁢

    ⁡Источник: ⁡⁢qna.habr.com⁡ValeriyaWork: если не поможет, ⁡⁢

    Почему не происходит обновление пакетов Debian?

    ⁡Выложите, пожалуйста.⁡Нужно доустановить пакеты apache, ⁡Источник: ⁡После этого запустите apt ⁡каталоге ⁡журнале изменений⁡как редакции выпусков.⁡к последним обновлениям безопасности:⁡безопасности. Информацию о всех ⁡olesya99 ⁡iptables? Закрыли доступ?
    ⁡то почему этого не ⁡обновления системы, ввел aptitude ⁡обновления debian, то здесь ⁡2020-12-05 18:18:05⁡.⁡тогда так⁡а что выдаст если:⁡но не получается, например
    ⁡.⁡update и затем apt ⁡dists/bullseye-proposed-updates⁡⁢

    ⁡.⁡⁢ ⁡Первая редакция, 11.1, была ⁡⁢

    Ответы:

    1. ⁡После этого запустите apt ⁡⁢ ⁡проблемах безопасности, найденных в ⁡⁢
      ⁡2021-01-08 09:36:22⁡Источник: ⁡⁢

    ⁡делается в консоли линукса, ⁡⁢qna.habr.com⁡update все, ошибка подключения ⁡⁢

    Похожие статьи

    I have a Rails application that I want to deploy using Docker on an Ubuntu server. I have the Dockerfile for the application already set up, right now I want to view the nginx conf in its container.

    I ran the command below to start an nginx container in an interactive mode:

    docker run -i -t nginx:latest /bin/bash
    

    Right now I am trying to install nano editor in order to view the configuration for nginx configuration (nginx.conf) using the commands below:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    However, when I run the first command apt-get update, I get the error below:

    Err:1 http://security.debian.org/debian-security buster/updates InRelease
      Temporary failure resolving 'security.debian.org'
    Err:2 http://deb.debian.org/debian buster InRelease                  
      Temporary failure resolving 'deb.debian.org'
    Err:3 http://deb.debian.org/debian buster-updates InRelease
      Temporary failure resolving 'deb.debian.org'
    Reading package lists... Done    
    W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
    W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    

    I have checked very well it has nothing to do with network connectivity. I would need some help. Thank you.

    asked May 2, 2020 at 22:58

    Promise Preston's user avatar

    Promise PrestonPromise Preston

    21.1k11 gold badges127 silver badges128 bronze badges

    1

    Try restarting docker. Worked for me.

    sudo service docker restart or sudo /etc/init.d/docker restart

    Prior to bumping into this issue, docker was working fine. If you never had docker working in the first place, you probably have a different issue.

    answered Sep 24, 2020 at 20:14

    Mario Olivio Flores's user avatar

    4

    Perhaps the network on the VM is not communicating with the default network created by docker during the build (bridge), so try «host» network :

    docker build --network host -t [image_name]
    

    for docker-compose:

    service_name:
        container_name: name
        build: 
          context: .
          network: host
    

    Ken Aqshal's user avatar

    answered Mar 19, 2021 at 20:00

    manumazu's user avatar

    manumazumanumazu

    6134 silver badges2 bronze badges

    6

    If you have VPN running, stop it and try again. It solved for me!

    answered Aug 14, 2020 at 15:26

    Francisco Cardoso's user avatar

    1

    Here’s how I solved it:

    Start the docker container for the application in an interactive mode, in my case it an nginx container :

    docker run -i -t nginx:latest /bin/bash
    

    Run the command below to grant read permission to the others role for the resolv.conf file:

    chmod o+r /etc/resolv.conf
    

    Note: If you are having this issue on your host machine (Ubuntu Linux OS) and not for the Docker containers, then run the same command adding sudo to it in the host machine terminal:

    sudo chmod o+r /etc/resolv.conf
    

    Endeavour to exit your bash interactive terminal once you run this:

    exit
    

    And then open a new bash interactive terminal and run the commands again:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    Everything should work fine now.

    Reference to this on Digital Ocean: Apt error: Temporary failure resolving ‘deb.debian.org’

    That’s all.

    Asclepius's user avatar

    Asclepius

    54.5k16 gold badges157 silver badges139 bronze badges

    answered May 2, 2020 at 22:58

    Promise Preston's user avatar

    Promise PrestonPromise Preston

    21.1k11 gold badges127 silver badges128 bronze badges

    1

    sudo vi /etc/docker/daemon.json
    

    and check flag of iptables, aslo add DNS if not added

    {...., "iptables":true,"dns": ["8.8.8.8", "8.8.4.4"]}
    

    then

    sudo service docker restart
    

    solved me

    answered Apr 14, 2022 at 10:23

    Victor Orletchi's user avatar

    Victor OrletchiVictor Orletchi

    4211 gold badge4 silver badges14 bronze badges

    I had the same problem and in my case it was file access control.

    I uses extended acls on the docker root folder and did not realize it, because they where inherited from the folder above (stupid idea to test docker in a «scratch» directory where permissions are set via extended acls).

    This lead to the situation that «/etc/resolv.conf» had setting «640» inside the running docker container with a «+» marking the extended acls. But the image did not have extended acls installed and could not handle it.

    The weird thing was that, as far as I can see, all other network tools worked (e.g. ping) but only apt could no access the DNS resolver.

    After removing the extended acls from the docker root and setting the usual acls, everything worked inside the running container.

    Similar to the answer of «Promise Prestion», but solved permanently for new containers, too.

    answered Mar 25, 2021 at 14:50

    Marco's user avatar

    MarcoMarco

    7496 silver badges11 bronze badges

    0

    Run this command:

    echo -e «nameserver 8.8.8.8nnameserver 8.8.4.4» |sudo tee -a /etc/resolv.conf

    After that run-

    sudo apt-get update

    This worked for me.

    answered May 20, 2022 at 6:30

    Md Ashikuzzaman 's user avatar

    1

    I easily resolved it via:

    - docker exec -it nginx bash (Go inside container)
    - ping google.com (if not working)
    - exit (Exit from container)
    - sudo service docker restart
    

    Please also confirms /etc/sysctl.conf

    - net.ipv4.ip_forward = 1
    

    sudo sysctl -p /etc/sysctl.conf

    answered May 3, 2020 at 4:57

    Jaydip Chabhadiya's user avatar

    Under Debian, as root, I’ve ran:

    /etc/init.d/docker restart
    

    This solved the issue for me.

    Then build and run the container again.

    sɐunıɔןɐqɐp's user avatar

    sɐunıɔןɐqɐp

    3,14715 gold badges35 silver badges39 bronze badges

    answered Jan 27, 2021 at 19:17

    JemmyX's user avatar

    I was having the wrong DNS IP address in my /etc/docker/daemon.json. In my case, it was my home router DNS IP address and I was trying from the office network.
    I found out my office DNS and updated with that.

    { 
      "dns": ["192.168.1.1"] 
    }
    

    Eric Aya's user avatar

    Eric Aya

    69.1k35 gold badges179 silver badges250 bronze badges

    answered Jun 29, 2022 at 17:59

    shubham rasal's user avatar

    1

    Similar issue, under debian.
    Root cause was a bad DOCKER-USER rule in iptables chain

    Those rules have been haded

    iptables -I DOCKER-USER -i eno1 -j DROP
    iptables -I DOCKER-USER -s 90.62.xxx.xx/32 -i eno1 -j ACCEPT
    

    so removing temporarily following rule fix the point

    iptables -D DOCKER-USER -i eno1 -j DROP
    

    answered Jul 15, 2021 at 13:35

    c-tools's user avatar

    Coming here from some docker cross compiling headache:

    While forking some repo I manually downloaded its root folder containing confd stuff and added it just like the original maintainer did.

    ADD root /
    

    after this I was not able to apt update anymore.

    I found that the permission of my root named folder was wrong. stat -f "%OLp" root revealed it is 700, but must be 755 to work.

    answered Oct 9, 2021 at 22:02

    Max's user avatar

    MaxMax

    4822 gold badges4 silver badges14 bronze badges

    I had a similar issue, I tried many suggested solutions, but my issue was gone after I rebooted my VM.

    Asclepius's user avatar

    Asclepius

    54.5k16 gold badges157 silver badges139 bronze badges

    answered Sep 2, 2020 at 14:30

    babis21's user avatar

    babis21babis21

    1,2951 gold badge15 silver badges27 bronze badges

    I’m using Arch version 6.0.11 and docker version 20.10.21, and having this issues inside docker containers.

    Thanks to @Marco, that was the initial hint to solve this. The problem is related to the use of extended ACLs in the host system.

    The docker root folder has ACLs, you can see this as it has a plus sign at the end of permissions «+»:

    $ sudo ls -lh /var/lib/docker
    drw-rw-r--+    3 root root 4.0K Nov 24  2021 network
    

    And what is the problem? Some docker images does not have ACLs installed, so as it was pointed this causes an issue.

    Other network tools like curl resolved DNS properly, but apt or git have problems with DNS resolution.


    TLDR; Where is the fix? Modify ACL to set default rx to others.

    setfacl -R -d -m o::rx /var/lib/docker
    

    After that, all network tools will be able to perform DNS resolution.

    Credits:

    Marco comment

    Closed git issue in docker

    Antoine's user avatar

    Antoine

    1,3714 gold badges20 silver badges26 bronze badges

    answered Dec 11, 2022 at 18:55

    A.Rodriguez's user avatar

    I have a Rails application that I want to deploy using Docker on an Ubuntu server. I have the Dockerfile for the application already set up, right now I want to view the nginx conf in its container.

    I ran the command below to start an nginx container in an interactive mode:

    docker run -i -t nginx:latest /bin/bash
    

    Right now I am trying to install nano editor in order to view the configuration for nginx configuration (nginx.conf) using the commands below:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    However, when I run the first command apt-get update, I get the error below:

    Err:1 http://security.debian.org/debian-security buster/updates InRelease
      Temporary failure resolving 'security.debian.org'
    Err:2 http://deb.debian.org/debian buster InRelease                  
      Temporary failure resolving 'deb.debian.org'
    Err:3 http://deb.debian.org/debian buster-updates InRelease
      Temporary failure resolving 'deb.debian.org'
    Reading package lists... Done    
    W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
    W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    

    I have checked very well it has nothing to do with network connectivity. I would need some help. Thank you.

    asked May 2, 2020 at 22:58

    Promise Preston's user avatar

    Promise PrestonPromise Preston

    21.1k11 gold badges127 silver badges128 bronze badges

    1

    Try restarting docker. Worked for me.

    sudo service docker restart or sudo /etc/init.d/docker restart

    Prior to bumping into this issue, docker was working fine. If you never had docker working in the first place, you probably have a different issue.

    answered Sep 24, 2020 at 20:14

    Mario Olivio Flores's user avatar

    4

    Perhaps the network on the VM is not communicating with the default network created by docker during the build (bridge), so try «host» network :

    docker build --network host -t [image_name]
    

    for docker-compose:

    service_name:
        container_name: name
        build: 
          context: .
          network: host
    

    Ken Aqshal's user avatar

    answered Mar 19, 2021 at 20:00

    manumazu's user avatar

    manumazumanumazu

    6134 silver badges2 bronze badges

    6

    If you have VPN running, stop it and try again. It solved for me!

    answered Aug 14, 2020 at 15:26

    Francisco Cardoso's user avatar

    1

    Here’s how I solved it:

    Start the docker container for the application in an interactive mode, in my case it an nginx container :

    docker run -i -t nginx:latest /bin/bash
    

    Run the command below to grant read permission to the others role for the resolv.conf file:

    chmod o+r /etc/resolv.conf
    

    Note: If you are having this issue on your host machine (Ubuntu Linux OS) and not for the Docker containers, then run the same command adding sudo to it in the host machine terminal:

    sudo chmod o+r /etc/resolv.conf
    

    Endeavour to exit your bash interactive terminal once you run this:

    exit
    

    And then open a new bash interactive terminal and run the commands again:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    Everything should work fine now.

    Reference to this on Digital Ocean: Apt error: Temporary failure resolving ‘deb.debian.org’

    That’s all.

    Asclepius's user avatar

    Asclepius

    54.5k16 gold badges157 silver badges139 bronze badges

    answered May 2, 2020 at 22:58

    Promise Preston's user avatar

    Promise PrestonPromise Preston

    21.1k11 gold badges127 silver badges128 bronze badges

    1

    sudo vi /etc/docker/daemon.json
    

    and check flag of iptables, aslo add DNS if not added

    {...., "iptables":true,"dns": ["8.8.8.8", "8.8.4.4"]}
    

    then

    sudo service docker restart
    

    solved me

    answered Apr 14, 2022 at 10:23

    Victor Orletchi's user avatar

    Victor OrletchiVictor Orletchi

    4211 gold badge4 silver badges14 bronze badges

    I had the same problem and in my case it was file access control.

    I uses extended acls on the docker root folder and did not realize it, because they where inherited from the folder above (stupid idea to test docker in a «scratch» directory where permissions are set via extended acls).

    This lead to the situation that «/etc/resolv.conf» had setting «640» inside the running docker container with a «+» marking the extended acls. But the image did not have extended acls installed and could not handle it.

    The weird thing was that, as far as I can see, all other network tools worked (e.g. ping) but only apt could no access the DNS resolver.

    After removing the extended acls from the docker root and setting the usual acls, everything worked inside the running container.

    Similar to the answer of «Promise Prestion», but solved permanently for new containers, too.

    answered Mar 25, 2021 at 14:50

    Marco's user avatar

    MarcoMarco

    7496 silver badges11 bronze badges

    0

    Run this command:

    echo -e «nameserver 8.8.8.8nnameserver 8.8.4.4» |sudo tee -a /etc/resolv.conf

    After that run-

    sudo apt-get update

    This worked for me.

    answered May 20, 2022 at 6:30

    Md Ashikuzzaman 's user avatar

    1

    I easily resolved it via:

    - docker exec -it nginx bash (Go inside container)
    - ping google.com (if not working)
    - exit (Exit from container)
    - sudo service docker restart
    

    Please also confirms /etc/sysctl.conf

    - net.ipv4.ip_forward = 1
    

    sudo sysctl -p /etc/sysctl.conf

    answered May 3, 2020 at 4:57

    Jaydip Chabhadiya's user avatar

    Under Debian, as root, I’ve ran:

    /etc/init.d/docker restart
    

    This solved the issue for me.

    Then build and run the container again.

    sɐunıɔןɐqɐp's user avatar

    sɐunıɔןɐqɐp

    3,14715 gold badges35 silver badges39 bronze badges

    answered Jan 27, 2021 at 19:17

    JemmyX's user avatar

    I was having the wrong DNS IP address in my /etc/docker/daemon.json. In my case, it was my home router DNS IP address and I was trying from the office network.
    I found out my office DNS and updated with that.

    { 
      "dns": ["192.168.1.1"] 
    }
    

    Eric Aya's user avatar

    Eric Aya

    69.1k35 gold badges179 silver badges250 bronze badges

    answered Jun 29, 2022 at 17:59

    shubham rasal's user avatar

    1

    Similar issue, under debian.
    Root cause was a bad DOCKER-USER rule in iptables chain

    Those rules have been haded

    iptables -I DOCKER-USER -i eno1 -j DROP
    iptables -I DOCKER-USER -s 90.62.xxx.xx/32 -i eno1 -j ACCEPT
    

    so removing temporarily following rule fix the point

    iptables -D DOCKER-USER -i eno1 -j DROP
    

    answered Jul 15, 2021 at 13:35

    c-tools's user avatar

    Coming here from some docker cross compiling headache:

    While forking some repo I manually downloaded its root folder containing confd stuff and added it just like the original maintainer did.

    ADD root /
    

    after this I was not able to apt update anymore.

    I found that the permission of my root named folder was wrong. stat -f "%OLp" root revealed it is 700, but must be 755 to work.

    answered Oct 9, 2021 at 22:02

    Max's user avatar

    MaxMax

    4822 gold badges4 silver badges14 bronze badges

    I had a similar issue, I tried many suggested solutions, but my issue was gone after I rebooted my VM.

    Asclepius's user avatar

    Asclepius

    54.5k16 gold badges157 silver badges139 bronze badges

    answered Sep 2, 2020 at 14:30

    babis21's user avatar

    babis21babis21

    1,2951 gold badge15 silver badges27 bronze badges

    I’m using Arch version 6.0.11 and docker version 20.10.21, and having this issues inside docker containers.

    Thanks to @Marco, that was the initial hint to solve this. The problem is related to the use of extended ACLs in the host system.

    The docker root folder has ACLs, you can see this as it has a plus sign at the end of permissions «+»:

    $ sudo ls -lh /var/lib/docker
    drw-rw-r--+    3 root root 4.0K Nov 24  2021 network
    

    And what is the problem? Some docker images does not have ACLs installed, so as it was pointed this causes an issue.

    Other network tools like curl resolved DNS properly, but apt or git have problems with DNS resolution.


    TLDR; Where is the fix? Modify ACL to set default rx to others.

    setfacl -R -d -m o::rx /var/lib/docker
    

    After that, all network tools will be able to perform DNS resolution.

    Credits:

    Marco comment

    Closed git issue in docker

    Antoine's user avatar

    Antoine

    1,3714 gold badges20 silver badges26 bronze badges

    answered Dec 11, 2022 at 18:55

    A.Rodriguez's user avatar

    Léa Massiot

    Posts: 28
    Joined: 2011-10-16 12:30

    Temporary failure resolving ‘deb.debian.org’

    #1

    Post

    by Léa Massiot » 2020-11-27 14:49

    Hi,
    I am trying to update my Debian Buster machine.

    My «/etc/apt/sources.lists» is:

    Code: Select all

    # Security updates
    deb http://security.debian.org/ buster/updates main contrib non-free
    deb-src http://security.debian.org/ buster/updates main contrib non-free
    
    ## Debian mirror
    
    # Base repository
    deb https://deb.debian.org/debian buster main contrib non-free
    deb-src https://deb.debian.org/debian buster main contrib non-free
    
    # Stable updates
    deb https://deb.debian.org/debian buster-updates main contrib non-free
    deb-src https://deb.debian.org/debian buster-updates main contrib non-free
    
    # Stable backports
    deb https://deb.debian.org/debian buster-backports main contrib non-free
    deb-src https://deb.debian.org/debian buster-backports main contrib non-free

    I am getting the errors below:

    Code: Select all

    root# apt-get update
    Hit:1 http://security.debian.org buster/updates InRelease
    Err:2 https://deb.debian.org/debian buster InRelease
      Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    Err:3 https://deb.debian.org/debian buster-updates InRelease
      Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    Err:4 https://deb.debian.org/debian buster-backports InRelease
      Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    Reading package lists... Done
    W: Failed to fetch https://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    W: Failed to fetch https://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    W: Failed to fetch https://deb.debian.org/debian/dists/buster-backports/InRelease  Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    W: Some index files failed to download. They have been ignored, or old ones used instead.

    Best regards.




    Автор zema, 29 апреля 2020, 16:36:25

    « назад — далее »

    0 Пользователи и 1 гость просматривают эту тему.

    Стоит файлопомойка на Debian c 6 версии обновлял до 9 и ядра пере собирал было всё нормально. Несколько месяцев назад ( может пол года) не стал работать apt-get update Ошибка «Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY «

    Никакие советы из интернета не помогали. Недавно дома с нуля переставил Debian 10 настроил основные службы, принёс на работу меняю подсеть на нужную (192.168.88 на 192.168.0 ) в /etc/network/interfaces и в /etc/resolv.conf . также побывал nameserver 8.8.8.8 в /etc/resolv.conf

    и получаю ошибку:
    Не удалось получить http://deb.debian.org/debian/dists/buster/InRelease  Временная ошибка при разрешении «deb.debian.org»

    Вроде бы  DNS, но ping по именам проходит. Раньше в sources.list помогало смена имён на IP, но не в этот раз.

    прописываю в apt.conf прокси и получаю  Ошибку «Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY «

    То есть с чего начал тем и закончил.

    Дома остался винт с Debian (на котором всё работает) клонирую приношу на работу ситуация повторяется, ставлю на другой компьютер тоже самое.
    На роутере снимал все запрещающие правила ничего не меняется. Под Windows сеть работает без вопросов.
    Приношу винт домой, меняю ip и apt-get update также не работает.

    В чём может быть засада?


    Ошибка явно в настройках сети, где конкретно — без понятия. т.к. наворотить можно что угодно.


    они где то ещё есть кроме /etc/network/interfaces /etc/resolv.conf ?


    Про ошибку с подписями репозиториев — покажите список источников /etc/apt/sources.list



    • Русскоязычное сообщество Debian GNU/Linux


    • Общие вопросы

    • apt-get update не работает

    What does this show you?:

    $ awk '{if($1=="hosts:")print;}' /etc/nsswitch.conf

    And this?:

    $ awk '{if($1=="nameserver")print;}' /etc/resolv.conf

    Does the above show you one or more nameserver IP addresses with lines of 2 fields,first being the literal string nameserver and second being an IP address properly formatted
    either as canonical IPv4 dotted quad or IPv6 form per the relevant RFCs, e.g. like:
    127.0.0.1 and not 2130706433, or
    2001:470:1f05:19e::2 and not 42540578174768546535349679483323940866
    And, for the one or more IP addresses you got from the above from your /etc/resolv.conf file, can you in fact resolve against them — and also can you reach and connect to TCP port 53 on them (e.g. via telnet, nc, netmap — or even ssh specifying the target port and using the -v option so you can see if it connects or not).
    If you have such connectivity, can you resolve against them, e.g.:
    $ dig @IP_address_of_YOUR_nameserver +noall +answer +comments deb.debian.org. A deb.debian.org. AAAA
    e.g.:

    $ cat /etc/resolv.conf
    nameserver 127.0.0.1
    $ dig @127.0.0.1 +noall +answer +comments deb.debian.org. A deb.debian.org. AAAA
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33197
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 9
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ; COOKIE: 6595d1d103dfba908016d85d60b31ac1b2dce7428ccd119d (good)
    ;; ANSWER SECTION:
    deb.debian.org.         3370    IN      CNAME   debian.map.fastlydns.net.
    debian.map.fastlydns.net. 30    IN      A       151.101.42.132
    
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25639
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 9
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ; COOKIE: 6595d1d103dfba908e9ca46860b31ac144a786b1c048bc46 (good)
    ;; ANSWER SECTION:
    deb.debian.org.         3370    IN      CNAME   debian.map.fastlydns.net.
    debian.map.fastlydns.net. 30    IN      AAAA    2a04:4e42:a::644
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 9
    
    $ 
    

    If you don’t have dig you can install it from the dnsutlis package … «of course» that may be easiest to do if you first have working DNS. Alternatively to dig, if you have them installed, you might be able to use delv, nslookup, or hosts — but they each have their own syntax — Debian provides man pages — you can use them.

    Issue

    I have a Rails application that I want to deploy using Docker on an Ubuntu server. I have the Dockerfile for the application already set up, right now I want to view the nginx conf in its container.

    I ran the command below to start an nginx container in an interactive mode:

    docker run -i -t nginx:latest /bin/bash
    

    Right now I am trying to install nano editor in order to view the configuration for nginx configuration (nginx.conf) using the commands below:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    However, when I run the first command apt-get update, I get the error below:

    Err:1 http://security.debian.org/debian-security buster/updates InRelease
      Temporary failure resolving 'security.debian.org'
    Err:2 http://deb.debian.org/debian buster InRelease                  
      Temporary failure resolving 'deb.debian.org'
    Err:3 http://deb.debian.org/debian buster-updates InRelease
      Temporary failure resolving 'deb.debian.org'
    Reading package lists... Done    
    W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
    W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    

    I have checked very well it has nothing to do with network connectivity. I would need some help. Thank you.

    Solution

    Here’s how I solved it:

    Start the docker container for the application in an interactive mode, in my case it an nginx container :

    docker run -i -t nginx:latest /bin/bash
    

    Run the command below to grant read permission to the others role for the resolv.conf file:

    chmod o+r /etc/resolv.conf
    

    Note: If you are having this issue on your host machine (Ubuntu Linux OS) and not for the Docker containers, then run the same command adding sudo to it in the host machine terminal:

    sudo chmod o+r /etc/resolv.conf
    

    Endeavour to exit your bash interactive terminal once you run this:

    exit
    

    And then open a new bash interactive terminal and run the commands again:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    Everything should work fine now.

    Reference to this on Digital Ocean: Apt error: Temporary failure resolving ‘deb.debian.org’

    That’s all.

    I hope this helps

    Answered By — Promise Preston

    sambale

    Posts: 1
    Joined: 2014-11-06 23:23

    apt-get update could not resolve ‘security.debian.org’

    #1

    Post

    by sambale » 2014-11-06 23:30

    Hi everyone,

    I am a beginner using debian linux on beaglebone board.
    I am trying to update using this command
    apt-get update
    But I am getting the following error

    Could anyone please help me this this? It’s a bit urgent :-/

    Thanks in advance!

    Code: Select all

    root@beaglebone:~# apt-get install ntp
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package ntp is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    
    E: Package 'ntp' has no installation candidate
    root@beaglebone:~# apt-get update
    Err http://security.debian.org wheezy/updates Release.gpg
      Could not resolve 'security.debian.org'
    Err http://ftp.debian.org wheezy Release.gpg
      Could not resolve 'ftp.debian.org'
    Err http://ftp.debian.org wheezy-updates Release.gpg
      Could not resolve 'ftp.debian.org'
    Reading package lists... Done
    W: Failed to fetch http://ftp.debian.org/debian/dists/wheezy/Release.gpg  Could not resolve 'ftp.debian.org'
    
    W: Failed to fetch http://security.debian.org/dists/wheezy/updates/Release.gpg  Could not resolve 'security.debian.org'
    
    W: Failed to fetch http://ftp.debian.org/debian/dists/wheezy-updates/Release.gpg  Could not resolve 'ftp.debian.org'
    
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    


    User avatar

    buzzin

    Posts: 121
    Joined: 2013-12-31 09:42

    Re: apt-get update could not resolve ‘security.debian.org’

    #3

    Post

    by buzzin » 2014-11-07 06:35

    It’s not security alone.
    The output you posted shows that none of the names can be resolved.
    Is DNS working on this machine at all?
    does ‘host www.google.com’ give a correct answer?
    and does ping 8.8.8.8 work?

    If the first command I gave fails, but the second one works: DNS resolving isn’t set up correctly. Please add ‘nameserver 8.8.8.8’ to the /etc/resolv.conf file and try again.
    If both don’t work: you don’t have a proper internet connection, please figure out if you network is working at all…

    Last edited by buzzin on 2014-11-07 13:04, edited 1 time in total.

    Sysadmin/KDE user


    reinob

    Posts: 1135
    Joined: 2014-06-30 11:42
    Has thanked: 76 times
    Been thanked: 36 times

    Re: apt-get update could not resolve ‘security.debian.org’

    #4

    Post

    by reinob » 2014-11-07 08:25

    buzzin wrote:It’s not security alone.
    The output you posted shows that none of the names can be resolved.
    Is DNS working on this machine at all?
    does ‘host http://www.google.com’ give a correct answer?
    and does ping 8.8.8.8 work?

    If the first command I gave fails, but the second one works: DNS resolving isn’t set up correctly. Please add ‘nameserver 8.8.8.8’ to the /etc/resolv.conf file and try again.
    If both don’t work: you don’t have a proper internet connection, please figure out if you network is working at all…

    Correction: «host www.google.com». Drop the «http://» which has nothing to do with DNS.

    Please kindly post the contents of /etc/resolv.conf. If it only says «127.0.0.1» please explain how you have configured the network (have you installed dnsmasq?, are you using DHCP?)



    I have a Rails application that I want to deploy using Docker on an Ubuntu server. I have the Dockerfile for the application already set up, right now I want to view the nginx conf in its container.

    I ran the command below to start an nginx container in an interactive mode:

    docker run -i -t nginx:latest /bin/bash
    

    Right now I am trying to install nano editor in order to view the configuration for nginx configuration (nginx.conf) using the commands below:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    However, when I run the first command apt-get update, I get the error below:

    Err:1 http://security.debian.org/debian-security buster/updates InRelease
      Temporary failure resolving 'security.debian.org'
    Err:2 http://deb.debian.org/debian buster InRelease                  
      Temporary failure resolving 'deb.debian.org'
    Err:3 http://deb.debian.org/debian buster-updates InRelease
      Temporary failure resolving 'deb.debian.org'
    Reading package lists... Done    
    W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
    W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    

    I have checked very well it has nothing to do with network connectivity. I would need some help. Thank you.

    asked May 2, 2020 at 22:58

    Promise Preston's user avatar

    Promise PrestonPromise Preston

    21.1k11 gold badges127 silver badges128 bronze badges

    1

    Try restarting docker. Worked for me.

    sudo service docker restart or sudo /etc/init.d/docker restart

    Prior to bumping into this issue, docker was working fine. If you never had docker working in the first place, you probably have a different issue.

    answered Sep 24, 2020 at 20:14

    Mario Olivio Flores's user avatar

    4

    Perhaps the network on the VM is not communicating with the default network created by docker during the build (bridge), so try «host» network :

    docker build --network host -t [image_name]
    

    for docker-compose:

    service_name:
        container_name: name
        build: 
          context: .
          network: host
    

    Ken Aqshal's user avatar

    answered Mar 19, 2021 at 20:00

    manumazu's user avatar

    manumazumanumazu

    6134 silver badges2 bronze badges

    6

    If you have VPN running, stop it and try again. It solved for me!

    answered Aug 14, 2020 at 15:26

    Francisco Cardoso's user avatar

    1

    Here’s how I solved it:

    Start the docker container for the application in an interactive mode, in my case it an nginx container :

    docker run -i -t nginx:latest /bin/bash
    

    Run the command below to grant read permission to the others role for the resolv.conf file:

    chmod o+r /etc/resolv.conf
    

    Note: If you are having this issue on your host machine (Ubuntu Linux OS) and not for the Docker containers, then run the same command adding sudo to it in the host machine terminal:

    sudo chmod o+r /etc/resolv.conf
    

    Endeavour to exit your bash interactive terminal once you run this:

    exit
    

    And then open a new bash interactive terminal and run the commands again:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    Everything should work fine now.

    Reference to this on Digital Ocean: Apt error: Temporary failure resolving ‘deb.debian.org’

    That’s all.

    Asclepius's user avatar

    Asclepius

    54.5k16 gold badges157 silver badges139 bronze badges

    answered May 2, 2020 at 22:58

    Promise Preston's user avatar

    Promise PrestonPromise Preston

    21.1k11 gold badges127 silver badges128 bronze badges

    1

    sudo vi /etc/docker/daemon.json
    

    and check flag of iptables, aslo add DNS if not added

    {...., "iptables":true,"dns": ["8.8.8.8", "8.8.4.4"]}
    

    then

    sudo service docker restart
    

    solved me

    answered Apr 14, 2022 at 10:23

    Victor Orletchi's user avatar

    Victor OrletchiVictor Orletchi

    4211 gold badge4 silver badges14 bronze badges

    I had the same problem and in my case it was file access control.

    I uses extended acls on the docker root folder and did not realize it, because they where inherited from the folder above (stupid idea to test docker in a «scratch» directory where permissions are set via extended acls).

    This lead to the situation that «/etc/resolv.conf» had setting «640» inside the running docker container with a «+» marking the extended acls. But the image did not have extended acls installed and could not handle it.

    The weird thing was that, as far as I can see, all other network tools worked (e.g. ping) but only apt could no access the DNS resolver.

    After removing the extended acls from the docker root and setting the usual acls, everything worked inside the running container.

    Similar to the answer of «Promise Prestion», but solved permanently for new containers, too.

    answered Mar 25, 2021 at 14:50

    Marco's user avatar

    MarcoMarco

    7496 silver badges11 bronze badges

    0

    Run this command:

    echo -e «nameserver 8.8.8.8nnameserver 8.8.4.4» |sudo tee -a /etc/resolv.conf

    After that run-

    sudo apt-get update

    This worked for me.

    answered May 20, 2022 at 6:30

    Md Ashikuzzaman 's user avatar

    1

    I easily resolved it via:

    - docker exec -it nginx bash (Go inside container)
    - ping google.com (if not working)
    - exit (Exit from container)
    - sudo service docker restart
    

    Please also confirms /etc/sysctl.conf

    - net.ipv4.ip_forward = 1
    

    sudo sysctl -p /etc/sysctl.conf

    answered May 3, 2020 at 4:57

    Jaydip Chabhadiya's user avatar

    Under Debian, as root, I’ve ran:

    /etc/init.d/docker restart
    

    This solved the issue for me.

    Then build and run the container again.

    sɐunıɔןɐqɐp's user avatar

    sɐunıɔןɐqɐp

    3,14715 gold badges35 silver badges39 bronze badges

    answered Jan 27, 2021 at 19:17

    JemmyX's user avatar

    I was having the wrong DNS IP address in my /etc/docker/daemon.json. In my case, it was my home router DNS IP address and I was trying from the office network.
    I found out my office DNS and updated with that.

    { 
      "dns": ["192.168.1.1"] 
    }
    

    Eric Aya's user avatar

    Eric Aya

    69.1k35 gold badges179 silver badges250 bronze badges

    answered Jun 29, 2022 at 17:59

    shubham rasal's user avatar

    1

    Similar issue, under debian.
    Root cause was a bad DOCKER-USER rule in iptables chain

    Those rules have been haded

    iptables -I DOCKER-USER -i eno1 -j DROP
    iptables -I DOCKER-USER -s 90.62.xxx.xx/32 -i eno1 -j ACCEPT
    

    so removing temporarily following rule fix the point

    iptables -D DOCKER-USER -i eno1 -j DROP
    

    answered Jul 15, 2021 at 13:35

    c-tools's user avatar

    Coming here from some docker cross compiling headache:

    While forking some repo I manually downloaded its root folder containing confd stuff and added it just like the original maintainer did.

    ADD root /
    

    after this I was not able to apt update anymore.

    I found that the permission of my root named folder was wrong. stat -f "%OLp" root revealed it is 700, but must be 755 to work.

    answered Oct 9, 2021 at 22:02

    Max's user avatar

    MaxMax

    4822 gold badges4 silver badges14 bronze badges

    I had a similar issue, I tried many suggested solutions, but my issue was gone after I rebooted my VM.

    Asclepius's user avatar

    Asclepius

    54.5k16 gold badges157 silver badges139 bronze badges

    answered Sep 2, 2020 at 14:30

    babis21's user avatar

    babis21babis21

    1,2951 gold badge15 silver badges27 bronze badges

    I’m using Arch version 6.0.11 and docker version 20.10.21, and having this issues inside docker containers.

    Thanks to @Marco, that was the initial hint to solve this. The problem is related to the use of extended ACLs in the host system.

    The docker root folder has ACLs, you can see this as it has a plus sign at the end of permissions «+»:

    $ sudo ls -lh /var/lib/docker
    drw-rw-r--+    3 root root 4.0K Nov 24  2021 network
    

    And what is the problem? Some docker images does not have ACLs installed, so as it was pointed this causes an issue.

    Other network tools like curl resolved DNS properly, but apt or git have problems with DNS resolution.


    TLDR; Where is the fix? Modify ACL to set default rx to others.

    setfacl -R -d -m o::rx /var/lib/docker
    

    After that, all network tools will be able to perform DNS resolution.

    Credits:

    Marco comment

    Closed git issue in docker

    Antoine's user avatar

    Antoine

    1,3714 gold badges20 silver badges26 bronze badges

    answered Dec 11, 2022 at 18:55

    A.Rodriguez's user avatar

    I have a Rails application that I want to deploy using Docker on an Ubuntu server. I have the Dockerfile for the application already set up, right now I want to view the nginx conf in its container.

    I ran the command below to start an nginx container in an interactive mode:

    docker run -i -t nginx:latest /bin/bash
    

    Right now I am trying to install nano editor in order to view the configuration for nginx configuration (nginx.conf) using the commands below:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    However, when I run the first command apt-get update, I get the error below:

    Err:1 http://security.debian.org/debian-security buster/updates InRelease
      Temporary failure resolving 'security.debian.org'
    Err:2 http://deb.debian.org/debian buster InRelease                  
      Temporary failure resolving 'deb.debian.org'
    Err:3 http://deb.debian.org/debian buster-updates InRelease
      Temporary failure resolving 'deb.debian.org'
    Reading package lists... Done    
    W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
    W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    

    I have checked very well it has nothing to do with network connectivity. I would need some help. Thank you.

    asked May 2, 2020 at 22:58

    Promise Preston's user avatar

    Promise PrestonPromise Preston

    21.1k11 gold badges127 silver badges128 bronze badges

    1

    Try restarting docker. Worked for me.

    sudo service docker restart or sudo /etc/init.d/docker restart

    Prior to bumping into this issue, docker was working fine. If you never had docker working in the first place, you probably have a different issue.

    answered Sep 24, 2020 at 20:14

    Mario Olivio Flores's user avatar

    4

    Perhaps the network on the VM is not communicating with the default network created by docker during the build (bridge), so try «host» network :

    docker build --network host -t [image_name]
    

    for docker-compose:

    service_name:
        container_name: name
        build: 
          context: .
          network: host
    

    Ken Aqshal's user avatar

    answered Mar 19, 2021 at 20:00

    manumazu's user avatar

    manumazumanumazu

    6134 silver badges2 bronze badges

    6

    If you have VPN running, stop it and try again. It solved for me!

    answered Aug 14, 2020 at 15:26

    Francisco Cardoso's user avatar

    1

    Here’s how I solved it:

    Start the docker container for the application in an interactive mode, in my case it an nginx container :

    docker run -i -t nginx:latest /bin/bash
    

    Run the command below to grant read permission to the others role for the resolv.conf file:

    chmod o+r /etc/resolv.conf
    

    Note: If you are having this issue on your host machine (Ubuntu Linux OS) and not for the Docker containers, then run the same command adding sudo to it in the host machine terminal:

    sudo chmod o+r /etc/resolv.conf
    

    Endeavour to exit your bash interactive terminal once you run this:

    exit
    

    And then open a new bash interactive terminal and run the commands again:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    Everything should work fine now.

    Reference to this on Digital Ocean: Apt error: Temporary failure resolving ‘deb.debian.org’

    That’s all.

    Asclepius's user avatar

    Asclepius

    54.5k16 gold badges157 silver badges139 bronze badges

    answered May 2, 2020 at 22:58

    Promise Preston's user avatar

    Promise PrestonPromise Preston

    21.1k11 gold badges127 silver badges128 bronze badges

    1

    sudo vi /etc/docker/daemon.json
    

    and check flag of iptables, aslo add DNS if not added

    {...., "iptables":true,"dns": ["8.8.8.8", "8.8.4.4"]}
    

    then

    sudo service docker restart
    

    solved me

    answered Apr 14, 2022 at 10:23

    Victor Orletchi's user avatar

    Victor OrletchiVictor Orletchi

    4211 gold badge4 silver badges14 bronze badges

    I had the same problem and in my case it was file access control.

    I uses extended acls on the docker root folder and did not realize it, because they where inherited from the folder above (stupid idea to test docker in a «scratch» directory where permissions are set via extended acls).

    This lead to the situation that «/etc/resolv.conf» had setting «640» inside the running docker container with a «+» marking the extended acls. But the image did not have extended acls installed and could not handle it.

    The weird thing was that, as far as I can see, all other network tools worked (e.g. ping) but only apt could no access the DNS resolver.

    After removing the extended acls from the docker root and setting the usual acls, everything worked inside the running container.

    Similar to the answer of «Promise Prestion», but solved permanently for new containers, too.

    answered Mar 25, 2021 at 14:50

    Marco's user avatar

    MarcoMarco

    7496 silver badges11 bronze badges

    0

    Run this command:

    echo -e «nameserver 8.8.8.8nnameserver 8.8.4.4» |sudo tee -a /etc/resolv.conf

    After that run-

    sudo apt-get update

    This worked for me.

    answered May 20, 2022 at 6:30

    Md Ashikuzzaman 's user avatar

    1

    I easily resolved it via:

    - docker exec -it nginx bash (Go inside container)
    - ping google.com (if not working)
    - exit (Exit from container)
    - sudo service docker restart
    

    Please also confirms /etc/sysctl.conf

    - net.ipv4.ip_forward = 1
    

    sudo sysctl -p /etc/sysctl.conf

    answered May 3, 2020 at 4:57

    Jaydip Chabhadiya's user avatar

    Under Debian, as root, I’ve ran:

    /etc/init.d/docker restart
    

    This solved the issue for me.

    Then build and run the container again.

    sɐunıɔןɐqɐp's user avatar

    sɐunıɔןɐqɐp

    3,14715 gold badges35 silver badges39 bronze badges

    answered Jan 27, 2021 at 19:17

    JemmyX's user avatar

    I was having the wrong DNS IP address in my /etc/docker/daemon.json. In my case, it was my home router DNS IP address and I was trying from the office network.
    I found out my office DNS and updated with that.

    { 
      "dns": ["192.168.1.1"] 
    }
    

    Eric Aya's user avatar

    Eric Aya

    69.1k35 gold badges179 silver badges250 bronze badges

    answered Jun 29, 2022 at 17:59

    shubham rasal's user avatar

    1

    Similar issue, under debian.
    Root cause was a bad DOCKER-USER rule in iptables chain

    Those rules have been haded

    iptables -I DOCKER-USER -i eno1 -j DROP
    iptables -I DOCKER-USER -s 90.62.xxx.xx/32 -i eno1 -j ACCEPT
    

    so removing temporarily following rule fix the point

    iptables -D DOCKER-USER -i eno1 -j DROP
    

    answered Jul 15, 2021 at 13:35

    c-tools's user avatar

    Coming here from some docker cross compiling headache:

    While forking some repo I manually downloaded its root folder containing confd stuff and added it just like the original maintainer did.

    ADD root /
    

    after this I was not able to apt update anymore.

    I found that the permission of my root named folder was wrong. stat -f "%OLp" root revealed it is 700, but must be 755 to work.

    answered Oct 9, 2021 at 22:02

    Max's user avatar

    MaxMax

    4822 gold badges4 silver badges14 bronze badges

    I had a similar issue, I tried many suggested solutions, but my issue was gone after I rebooted my VM.

    Asclepius's user avatar

    Asclepius

    54.5k16 gold badges157 silver badges139 bronze badges

    answered Sep 2, 2020 at 14:30

    babis21's user avatar

    babis21babis21

    1,2951 gold badge15 silver badges27 bronze badges

    I’m using Arch version 6.0.11 and docker version 20.10.21, and having this issues inside docker containers.

    Thanks to @Marco, that was the initial hint to solve this. The problem is related to the use of extended ACLs in the host system.

    The docker root folder has ACLs, you can see this as it has a plus sign at the end of permissions «+»:

    $ sudo ls -lh /var/lib/docker
    drw-rw-r--+    3 root root 4.0K Nov 24  2021 network
    

    And what is the problem? Some docker images does not have ACLs installed, so as it was pointed this causes an issue.

    Other network tools like curl resolved DNS properly, but apt or git have problems with DNS resolution.


    TLDR; Where is the fix? Modify ACL to set default rx to others.

    setfacl -R -d -m o::rx /var/lib/docker
    

    After that, all network tools will be able to perform DNS resolution.

    Credits:

    Marco comment

    Closed git issue in docker

    Antoine's user avatar

    Antoine

    1,3714 gold badges20 silver badges26 bronze badges

    answered Dec 11, 2022 at 18:55

    A.Rodriguez's user avatar

    Léa Massiot

    Posts: 28
    Joined: 2011-10-16 12:30

    Temporary failure resolving ‘deb.debian.org’

    #1

    Post

    by Léa Massiot » 2020-11-27 14:49

    Hi,
    I am trying to update my Debian Buster machine.

    My «/etc/apt/sources.lists» is:

    Code: Select all

    # Security updates
    deb http://security.debian.org/ buster/updates main contrib non-free
    deb-src http://security.debian.org/ buster/updates main contrib non-free
    
    ## Debian mirror
    
    # Base repository
    deb https://deb.debian.org/debian buster main contrib non-free
    deb-src https://deb.debian.org/debian buster main contrib non-free
    
    # Stable updates
    deb https://deb.debian.org/debian buster-updates main contrib non-free
    deb-src https://deb.debian.org/debian buster-updates main contrib non-free
    
    # Stable backports
    deb https://deb.debian.org/debian buster-backports main contrib non-free
    deb-src https://deb.debian.org/debian buster-backports main contrib non-free

    I am getting the errors below:

    Code: Select all

    root# apt-get update
    Hit:1 http://security.debian.org buster/updates InRelease
    Err:2 https://deb.debian.org/debian buster InRelease
      Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    Err:3 https://deb.debian.org/debian buster-updates InRelease
      Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    Err:4 https://deb.debian.org/debian buster-backports InRelease
      Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    Reading package lists... Done
    W: Failed to fetch https://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    W: Failed to fetch https://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    W: Failed to fetch https://deb.debian.org/debian/dists/buster-backports/InRelease  Temporary failure resolving 'debian.map.fastly.net' Temporary failure resolving 'deb.debian.org'
    W: Some index files failed to download. They have been ignored, or old ones used instead.

    Best regards.




    Автор zema, 29 апреля 2020, 16:36:25

    « назад — далее »

    0 Пользователи и 1 гость просматривают эту тему.

    Стоит файлопомойка на Debian c 6 версии обновлял до 9 и ядра пере собирал было всё нормально. Несколько месяцев назад ( может пол года) не стал работать apt-get update Ошибка «Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY «

    Никакие советы из интернета не помогали. Недавно дома с нуля переставил Debian 10 настроил основные службы, принёс на работу меняю подсеть на нужную (192.168.88 на 192.168.0 ) в /etc/network/interfaces и в /etc/resolv.conf . также побывал nameserver 8.8.8.8 в /etc/resolv.conf

    и получаю ошибку:
    Не удалось получить http://deb.debian.org/debian/dists/buster/InRelease  Временная ошибка при разрешении «deb.debian.org»

    Вроде бы  DNS, но ping по именам проходит. Раньше в sources.list помогало смена имён на IP, но не в этот раз.

    прописываю в apt.conf прокси и получаю  Ошибку «Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY «

    То есть с чего начал тем и закончил.

    Дома остался винт с Debian (на котором всё работает) клонирую приношу на работу ситуация повторяется, ставлю на другой компьютер тоже самое.
    На роутере снимал все запрещающие правила ничего не меняется. Под Windows сеть работает без вопросов.
    Приношу винт домой, меняю ip и apt-get update также не работает.

    В чём может быть засада?


    Ошибка явно в настройках сети, где конкретно — без понятия. т.к. наворотить можно что угодно.


    они где то ещё есть кроме /etc/network/interfaces /etc/resolv.conf ?


    Про ошибку с подписями репозиториев — покажите список источников /etc/apt/sources.list



    • Русскоязычное сообщество Debian GNU/Linux


    • Общие вопросы

    • apt-get update не работает

    What does this show you?:

    $ awk '{if($1=="hosts:")print;}' /etc/nsswitch.conf

    And this?:

    $ awk '{if($1=="nameserver")print;}' /etc/resolv.conf

    Does the above show you one or more nameserver IP addresses with lines of 2 fields,first being the literal string nameserver and second being an IP address properly formatted
    either as canonical IPv4 dotted quad or IPv6 form per the relevant RFCs, e.g. like:
    127.0.0.1 and not 2130706433, or
    2001:470:1f05:19e::2 and not 42540578174768546535349679483323940866
    And, for the one or more IP addresses you got from the above from your /etc/resolv.conf file, can you in fact resolve against them — and also can you reach and connect to TCP port 53 on them (e.g. via telnet, nc, netmap — or even ssh specifying the target port and using the -v option so you can see if it connects or not).
    If you have such connectivity, can you resolve against them, e.g.:
    $ dig @IP_address_of_YOUR_nameserver +noall +answer +comments deb.debian.org. A deb.debian.org. AAAA
    e.g.:

    $ cat /etc/resolv.conf
    nameserver 127.0.0.1
    $ dig @127.0.0.1 +noall +answer +comments deb.debian.org. A deb.debian.org. AAAA
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33197
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 9
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ; COOKIE: 6595d1d103dfba908016d85d60b31ac1b2dce7428ccd119d (good)
    ;; ANSWER SECTION:
    deb.debian.org.         3370    IN      CNAME   debian.map.fastlydns.net.
    debian.map.fastlydns.net. 30    IN      A       151.101.42.132
    
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25639
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 9
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ; COOKIE: 6595d1d103dfba908e9ca46860b31ac144a786b1c048bc46 (good)
    ;; ANSWER SECTION:
    deb.debian.org.         3370    IN      CNAME   debian.map.fastlydns.net.
    debian.map.fastlydns.net. 30    IN      AAAA    2a04:4e42:a::644
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 4, ADDITIONAL: 9
    
    $ 
    

    If you don’t have dig you can install it from the dnsutlis package … «of course» that may be easiest to do if you first have working DNS. Alternatively to dig, if you have them installed, you might be able to use delv, nslookup, or hosts — but they each have their own syntax — Debian provides man pages — you can use them.

    Issue

    I have a Rails application that I want to deploy using Docker on an Ubuntu server. I have the Dockerfile for the application already set up, right now I want to view the nginx conf in its container.

    I ran the command below to start an nginx container in an interactive mode:

    docker run -i -t nginx:latest /bin/bash
    

    Right now I am trying to install nano editor in order to view the configuration for nginx configuration (nginx.conf) using the commands below:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    However, when I run the first command apt-get update, I get the error below:

    Err:1 http://security.debian.org/debian-security buster/updates InRelease
      Temporary failure resolving 'security.debian.org'
    Err:2 http://deb.debian.org/debian buster InRelease                  
      Temporary failure resolving 'deb.debian.org'
    Err:3 http://deb.debian.org/debian buster-updates InRelease
      Temporary failure resolving 'deb.debian.org'
    Reading package lists... Done    
    W: Failed to fetch http://deb.debian.org/debian/dists/buster/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Failed to fetch http://security.debian.org/debian-security/dists/buster/updates/InRelease  Temporary failure resolving 'security.debian.org'
    W: Failed to fetch http://deb.debian.org/debian/dists/buster-updates/InRelease  Temporary failure resolving 'deb.debian.org'
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    

    I have checked very well it has nothing to do with network connectivity. I would need some help. Thank you.

    Solution

    Here’s how I solved it:

    Start the docker container for the application in an interactive mode, in my case it an nginx container :

    docker run -i -t nginx:latest /bin/bash
    

    Run the command below to grant read permission to the others role for the resolv.conf file:

    chmod o+r /etc/resolv.conf
    

    Note: If you are having this issue on your host machine (Ubuntu Linux OS) and not for the Docker containers, then run the same command adding sudo to it in the host machine terminal:

    sudo chmod o+r /etc/resolv.conf
    

    Endeavour to exit your bash interactive terminal once you run this:

    exit
    

    And then open a new bash interactive terminal and run the commands again:

    apt-get update
    apt-get install nano
    export TERM=xterm
    

    Everything should work fine now.

    Reference to this on Digital Ocean: Apt error: Temporary failure resolving ‘deb.debian.org’

    That’s all.

    I hope this helps

    Answered By — Promise Preston

    sambale

    Posts: 1
    Joined: 2014-11-06 23:23

    apt-get update could not resolve ‘security.debian.org’

    #1

    Post

    by sambale »

    Hi everyone,

    I am a beginner using debian linux on beaglebone board.
    I am trying to update using this command
    apt-get update
    But I am getting the following error

    Could anyone please help me this this? It’s a bit urgent :-/

    Thanks in advance!

    Code: Select all

    root@beaglebone:~# apt-get install ntp
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package ntp is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    
    E: Package 'ntp' has no installation candidate
    root@beaglebone:~# apt-get update
    Err http://security.debian.org wheezy/updates Release.gpg
      Could not resolve 'security.debian.org'
    Err http://ftp.debian.org wheezy Release.gpg
      Could not resolve 'ftp.debian.org'
    Err http://ftp.debian.org wheezy-updates Release.gpg
      Could not resolve 'ftp.debian.org'
    Reading package lists... Done
    W: Failed to fetch http://ftp.debian.org/debian/dists/wheezy/Release.gpg  Could not resolve 'ftp.debian.org'
    
    W: Failed to fetch http://security.debian.org/dists/wheezy/updates/Release.gpg  Could not resolve 'security.debian.org'
    
    W: Failed to fetch http://ftp.debian.org/debian/dists/wheezy-updates/Release.gpg  Could not resolve 'ftp.debian.org'
    
    W: Some index files failed to download. They have been ignored, or old ones used instead.
    



    User avatar

    buzzin

    Posts: 121
    Joined: 2013-12-31 09:42

    Re: apt-get update could not resolve ‘security.debian.org’

    #3

    Post

    by buzzin »

    It’s not security alone.
    The output you posted shows that none of the names can be resolved.
    Is DNS working on this machine at all?
    does ‘host www.google.com’ give a correct answer?
    and does ping 8.8.8.8 work?

    If the first command I gave fails, but the second one works: DNS resolving isn’t set up correctly. Please add ‘nameserver 8.8.8.8’ to the /etc/resolv.conf file and try again.
    If both don’t work: you don’t have a proper internet connection, please figure out if you network is working at all…

    Last edited by buzzin on 2014-11-07 13:04, edited 1 time in total.

    Sysadmin/KDE user


    reinob

    Posts: 1159
    Joined: 2014-06-30 11:42
    Has thanked: 88 times
    Been thanked: 42 times

    Re: apt-get update could not resolve ‘security.debian.org’

    #4

    Post

    by reinob »

    buzzin wrote:It’s not security alone.
    The output you posted shows that none of the names can be resolved.
    Is DNS working on this machine at all?
    does ‘host http://www.google.com’ give a correct answer?
    and does ping 8.8.8.8 work?

    If the first command I gave fails, but the second one works: DNS resolving isn’t set up correctly. Please add ‘nameserver 8.8.8.8’ to the /etc/resolv.conf file and try again.
    If both don’t work: you don’t have a proper internet connection, please figure out if you network is working at all…

    Correction: «host www.google.com». Drop the «http://» which has nothing to do with DNS.

    Please kindly post the contents of /etc/resolv.conf. If it only says «127.0.0.1» please explain how you have configured the network (have you installed dnsmasq?, are you using DHCP?)



     apt, debian, sources.list


    0

    1

    Первый раз сталкиваюсь с такой проблемой, но даже спустя несколько часов не смог ничего починить. При минимальной загрузке Debian stable/testing появляются проблемы с apt, однако при загрузке с рабочим окружением все отлично работает.

    Сама ошибка:

    При запуске apt-get update такая же история, только с поправкой на:

    W: Некоторые индексные файлы не скачались. Они были проигнорированы или вместо них были использованы старые версии.

    Что содержится в sources.list:

    • Ссылка

    Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.

    Понравилась статья? Поделить с друзьями:
  1. Все виды грамматических ошибок 8 задание егэ
  2. Временная ошибка при разрешении ru archive ubuntu com
  3. Все было ошибкой ранобэ читать
  4. Временная ошибка при разрешении linux
  5. Временная ошибка при разрешении mirror yandex ru