unable to update ubuntu Docker container using apt-get update
the problem was with Internet connection, as mine connection is at enterprise level and because of that It was unable to execute apt-get update
command.
Solution worked for me is :
find your DNS server address using
cat /etc/resolv.conf
Open Docker confg file and uncomment
DOCKER_OPTS
and add your DNS server over there
Docker config file : sudo gedit /etc/default/docker
Related videos on Youtube
pbhadu21
Updated on September 18, 2022Comments
-
pbhadu21 over 1 year
when I run ubuntu as Docker container and when I run
apt-get update
command it gives error and fails to update the repos.Here is what error I'm getting :
root@df167e514b29:/# sudo bash: sudo: command not found root@df167e514b29:/# apt-get update Err:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'archive.ubuntu.com' Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Temporary failure resolving 'security.ubuntu.com' Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease Temporary failure resolving 'archive.ubuntu.com' Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Temporary failure resolving 'archive.ubuntu.com' Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Temporary failure resolving 'archive.ubuntu.com' W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Temporary failure resolving 'security.ubuntu.com' W: Some index files failed to download. They have been ignored, or old ones used instead. root@df167e514b29:/#-
N0rbert over 4 yearsHow do enter the Docker container? What is the host system? See askubuntu.com/a/1162198/66509 for possible solution.
-
pbhadu21 over 4 yearsactually I got solution for this thing. the problem was that internet connection I am using is at enterprise level, so I need to manually setup DNS server for docker. this thing sorted out the problem.
-
N0rbert over 4 yearsI'll recommend you to write an answer for your question. This will help other users if they face the same problem.
-
-
Henke over 3 yearsWhat solved it for me is askubuntu.com/questions/1162163#1162198.