Docker apt-get update报错

在Docker改apt源出现问题

root@1ad3e492d821:/etc/apt# apt-get update
Ign:1 http://mirrors.163.com/debian stretch InReleaseGet:2 http://mirrors.163.com/debian stretch-updates InRelease [93.6 kB]  
Get:3 http://mirrors.163.com/debian-security stretch/updates InRelease [53.0 kB]   
Get:4 http://mirrors.163.com/debian stretch Release [118 kB]
Err:2 http://mirrors.163.com/debian stretch-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138
Get:5 http://mirrors.163.com/debian stretch Release.gpg [3177 B]
Err:3 http://mirrors.163.com/debian-security stretch/updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AA8E81B4331F7F50 NO_PUBKEY 112695A0E562B32A
Ign:5 http://mirrors.163.com/debian stretch Release.gpg
Ign:6 http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 InRelease
Hit:7 http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 Release
Reading package lists... Done
W: GPG error: http://mirrors.163.com/debian stretch-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138
E: The repository 'http://mirrors.163.com/debian stretch-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.163.com/debian-security stretch/updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AA8E81B4331F7F50 NO_PUBKEY 112695A0E562B32A
E: The repository 'http://mirrors.163.com/debian-security stretch/updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://mirrors.163.com/debian stretch Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY EF0F382A1A7B6500
E: The repository 'http://mirrors.163.com/debian stretch Release' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys + 上面出现的公钥

如:apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138 AA8E81B4331F7F50 112695A0E562B32A

成功

root@1ad3e492d821:/etc/apt# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138 AA8E81B4331F7F50 112695A0E562B32A
Executing: /tmp/apt-key-gpghome.SrkDSou6uj/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC 648ACFD622F3D138 AA8E81B4331F7F50 112695A0E562B32A
gpg: key 4DFAB270CAA96DFA: public key "Debian Security Archive Automatic Signing Key (10/buster) " imported
gpg: key EDA0D2388AE22BA9: public key "Debian Security Archive Automatic Signing Key (9/stretch) " imported
gpg: key DC30D7C23CBBABEE: public key "Debian Archive Automatic Signing Key (10/buster) " imported
gpg: key E0B11894F66AEC98: public key "Debian Archive Automatic Signing Key (9/stretch) " imported
gpg: Total number processed: 4
gpg:               imported: 4
root@1ad3e492d821:/etc/apt# apt-get update
Ign:1 http://mirrors.163.com/debian stretch InRelease
Get:2 http://mirrors.163.com/debian stretch-updates InRelease [93.6 kB]  
Get:3 http://mirrors.163.com/debian-security stretch/updates InRelease [53.0 kB]   
Get:4 http://mirrors.163.com/debian stretch Release [118 kB]
Get:5 http://mirrors.163.com/debian stretch Release.gpg [3177 B]
Get:6 http://mirrors.163.com/debian-security stretch/updates/contrib amd64 Packages [1756 B]
Get:7 http://mirrors.163.com/debian-security stretch/updates/main amd64 Packages [969 kB]
Get:8 http://mirrors.163.com/debian-security stretch/updates/non-free amd64 Packages [6334 B]
Get:9 http://mirrors.163.com/debian stretch/main amd64 Packages [9610 kB]
Ign:10 http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 InRelease                                                                                   
Hit:11 http://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 Release                                                                                     
Get:12 http://mirrors.163.com/debian stretch/non-free amd64 Packages [94.8 kB]                                                                              
Get:13 http://mirrors.163.com/debian stretch/contrib amd64 Packages [61.1 kB]                                                                               
Fetched 11.0 MB in 13s (823 kB/s)                                                                                                                           
Reading package lists... Done

你可能感兴趣的:(docker,debian,运维)