我想安装git。但是这个错误是发出的。
在此之前,java和maven都是正常安装的。
有什么问题吗?
root@2367f80df87a:/# apt install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
git-man less libasn1-8-heimdal libcurl3-gnutls liberror-perl libgdbm-compat4 libgdbm5 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal
libheimntlm0-heimdal libhx509-5-heimdal libkrb5-26-heimdal libldap-2.4-2 libldap-common libnghttp2-14 libperl5.26 libpsl5 libroken18-heimdal librtmp1
libsasl2-2 libsasl2-modules libsasl2-modules-db libssl1.0.0 libwind0-heimdal netbase openssh-client patch perl perl-modules-5.26 publicsuffix xauth
Suggested packages:
gettext-base git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn gdbm-l10n
libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp libsasl2-modules-sql keychain libpam-ssh
monkeysphere ssh-askpass ed diffutils-doc perl-doc libterm-readline-gnu-perl | libterm-readline-perl-perl make
The following NEW packages will be installed:
git git-man less libasn1-8-heimdal libcurl3-gnutls liberror-perl libgdbm-compat4 libgdbm5 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal
libheimntlm0-heimdal libhx509-5-heimdal libkrb5-26-heimdal libldap-2.4-2 libldap-common libnghttp2-14 libperl5.26 libpsl5 libroken18-heimdal librtmp1
libsasl2-2 libsasl2-modules libsasl2-modules-db libssl1.0.0 libwind0-heimdal netbase openssh-client patch perl perl-modules-5.26 publicsuffix xauth
0 upgraded, 33 newly installed, 0 to remove and 2 not upgraded.
Need to get 14.8 MB of archives.
After this operation, 89.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Ign:1 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 perl-modules-5.26 all 5.26.1-6ubuntu0.3
Err:2 http://archive.ubuntu.com/ubuntu bionic/main amd64 libgdbm5 amd64 1.14.1-6
Temporary failure resolving 'archive.ubuntu.com'
Err:1 http://security.ubuntu.com/ubuntu bionic-updates/main amd64 perl-modules-5.26 all 5.26.1-6ubuntu0.3
Temporary failure resolving 'archive.ubuntu.com'
Err:3 http://archive.ubuntu.com/ubuntu bionic/main amd64 libgdbm-compat4 amd64 1.14.1-6
Temporary failure resolving 'archive.ubuntu.com'
Ign:4 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libperl5.26 amd64 5.26.1-6ubuntu0.3
0% [Connecting to security.ubuntu.com] [Connecting to archive.ubuntu.com]它没完没了地进行..。
upd。
@LinPy:答案:
root@2367f80df87a:/# apt-get update
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'archive.ubuntu.com'
0% [Connecting to archive.ubuntu.com]^C^[get update && apt-get install git
root@2367f80df87a:/# apt-get update && apt-get install git
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'archive.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'在执行"apt-get update“命令时,我也有类似的错误。
发布于 2020-01-16 13:08:25
您的码头引擎可能有DNS问题。
您可以通过运行以下命令来测试该理论:
docker run busybox ping archive.ubuntu.com看看能不能解决。
然后,做同样的事情,但是允许主机网络或者显式地提供DNS:
docker run --network host busybox ping archive.ubuntu.com
docker run --dns 8.8.8.8 busybox ping archive.ubuntu.com对于永久解决方案,您可能需要编辑/etc/docker/daemon.json并重新启动对接引擎:
{
"dns": ["192.10.0.2", "8.8.8.8"]
}https://stackoverflow.com/questions/59768628
复制相似问题