解决apt-get update更新问题:/usr/lib/apt/methods/https could not be found. 和 NO_PUBKEY 7EA0A9C3F273FCD8

问题1:The method driver /usr/lib/apt/methods/https could not be found.

解决办法--执行单独安装命令:apt-get install apt-transport-https

 

问题2:W: GPG error: https://download.docker.com/linux/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8

运行如下命令,添加公钥解决: apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 7EA0A9C3F273FCD8

 

错误信息:

root@2bade87bd9dd:/# apt-get update

Hit:1 http://mirrors.aliyun.com/ubuntu xenial InRelease

Get:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease [109 kB]                                  

Get:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease [107 kB]                                                                                            

Get:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease [107 kB]                                                                                          

Get:5 http://mirrors.aliyun.com/ubuntu xenial-updates/main Sources [406 kB]                                                                                        

Get:6 http://mirrors.aliyun.com/ubuntu xenial-updates/restricted Sources [2684 B]                                  

Get:7 http://archive.canonical.com/ubuntu xenial InRelease [11.5 kB]                     

Get:8 http://mirrors.aliyun.com/ubuntu xenial-updates/multiverse Sources [8995 B]                   

Hit:9 http://archive.ubuntu.com/ubuntu xenial InRelease                                       

Get:10 http://mirrors.aliyun.com/ubuntu xenial-updates/universe Sources [280 kB]

Get:11 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 Packages [1112 kB]

Get:12 http://archive.canonical.com/ubuntu xenial/partner Sources [2408 B]                               

Get:13 http://mirrors.aliyun.com/ubuntu xenial-updates/restricted amd64 Packages [13.1 kB]

Get:14 http://mirrors.aliyun.com/ubuntu xenial-updates/universe amd64 Packages [889 kB]

Get:15 http://archive.canonical.com/ubuntu xenial/partner amd64 Packages [3248 B]

Get:16 http://mirrors.aliyun.com/ubuntu xenial-updates/multiverse amd64 Packages [18.8 kB]

Get:17 http://mirrors.aliyun.com/ubuntu xenial-backports/main Sources [5103 B]

Get:18 http://mirrors.aliyun.com/ubuntu xenial-backports/universe Sources [7237 B]

Get:19 http://mirrors.aliyun.com/ubuntu xenial-backports/main amd64 Packages [7965 B]

Get:20 http://mirrors.aliyun.com/ubuntu xenial-backports/universe amd64 Packages [8532 B]

Get:21 http://mirrors.aliyun.com/ubuntu xenial-security/main Sources [167 kB]

Get:22 http://mirrors.aliyun.com/ubuntu xenial-security/multiverse Sources [2094 B]

Get:23 http://mirrors.aliyun.com/ubuntu xenial-security/universe Sources [95.4 kB]

Get:24 http://mirrors.aliyun.com/ubuntu xenial-security/main amd64 Packages [723 kB]

Get:25 http://mirrors.aliyun.com/ubuntu xenial-security/universe amd64 Packages [491 kB]

Get:26 http://mirrors.aliyun.com/ubuntu xenial-security/multiverse amd64 Packages [3747 B]

Fetched 4583 kB in 2s (2049 kB/s)                       

Reading package lists... Done

E: The method driver /usr/lib/apt/methods/https could not be found.

N: Is the package apt-transport-https installed?

E: Failed to fetch https://download.docker.com/linux/ubuntu/dists/xenial/InRelease 

E: Some index files failed to download. They have been ignored, or old ones used instead.

root@2bade87bd9dd:/#

解决办法--执行单独安装命令:apt-get install apt-transport-https

root@2bade87bd9dd:/# apt-get install apt-transport-https

Reading package lists... Done

Building dependency tree      

Reading state information... Done

The following package was automatically installed and is no longer required:

  libllvm5.0

Use 'apt autoremove' to remove it.

The following NEW packages will be installed:

  apt-transport-https

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

Need to get 26.1 kB of archives.

After this operation, 215 kB of additional disk space will be used.

Get:1 http://mirrors.aliyun.com/ubuntu xenial-updates/main amd64 apt-transport-https amd64 1.2.27 [26.1 kB]

Fetched 26.1 kB in 0s (446 kB/s)              

debconf: delaying package configuration, since apt-utils is not installed

Selecting previously unselected package apt-transport-https.

(Reading database ... 32433 files and directories currently installed.)

Preparing to unpack .../apt-transport-https_1.2.27_amd64.deb ...

Unpacking apt-transport-https (1.2.27) ...

Setting up apt-transport-https (1.2.27) ...

root@2bade87bd9dd:/#

 

root@2bade87bd9dd:/# apt-get update                     
Hit:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease                                            
Hit:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease                                                              
Hit:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease                                                               
Hit:5 http://archive.canonical.com/ubuntu xenial InRelease                                                                     
Get:6 https://download.docker.com/linux/ubuntu xenial InRelease [66.2 kB]       
Ign:6 https://download.docker.com/linux/ubuntu xenial InRelease                   
Get:7 https://download.docker.com/linux/ubuntu xenial/stable amd64 Packages [4467 B]
Hit:8 http://archive.ubuntu.com/ubuntu xenial InRelease                              
Fetched 70.7 kB in 3s (19.5 kB/s)                    
Reading package lists... Done
W: GPG error: https://download.docker.com/linux/ubuntu xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
W: The repository 'https://download.docker.com/linux/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@2bade87bd9dd:/# 

解决办法:

运行如下命令,添加公钥解决:

apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 7EA0A9C3F273FCD8

root@2bade87bd9dd:/# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 7EA0A9C3F273FCD8 
Executing: /tmp/tmp.1aB371lWPG/gpg.1.sh --recv-keys
--keyserver
keyserver.ubuntu.com
7EA0A9C3F273FCD8
gpg: requesting key F273FCD8 from hkp server keyserver.ubuntu.com
gpg: key 0EBFCD88: public key "Docker Release (CE deb) <docker@docker.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
root@2bade87bd9dd:/# 
root@2bade87bd9dd:/# 
root@2bade87bd9dd:/# apt-get update
Hit:1 http://mirrors.aliyun.com/ubuntu xenial InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu xenial-updates InRelease                                                                
Hit:3 http://mirrors.aliyun.com/ubuntu xenial-backports InRelease                                                              
Hit:4 http://mirrors.aliyun.com/ubuntu xenial-security InRelease                                                               
Hit:5 http://archive.ubuntu.com/ubuntu xenial InRelease                                                                        
Hit:6 http://archive.canonical.com/ubuntu xenial InRelease
Get:7 https://download.docker.com/linux/ubuntu xenial InRelease [66.2 kB]
Fetched 66.2 kB in 1s (50.8 kB/s)   
Reading package lists... Done

root@2bade87bd9dd:/# 

 

 

 

 

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值