• ubuntu apt-get更新出现W: GPG error: http://repo.mysql.com trusty InRelease


    一、问题

    在使用 apt-get update 在 Ubuntu 环境更新包资源时,出现了以下报错:

    Ign http://repo.mysql.com trusty/mysql-tools Translation-en                    
    Fetched 3,164 B in 1min 42s (30 B/s)                                           
    Reading package lists... Done
    W: GPG error: http://repo.mysql.com trusty InRelease: The following signatures were invalid: KEYEXPIRED 1487236823 KEYEXPIRED 1487236823 KEYEXPIRED 1487236823

    从报错的信息看是因为签名参数过期了,所以,这里需要删除后再更新。

    二、解决

    先查看执行命令:apt-key list

    root@iZ9:/var/www/html/gryphon# apt-key list
    /etc/apt/trusted.gpg
    --------------------
    pub   1024D/437D05B5 2004-09-12
    uid                  Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>
    sub   2048g/79164387 2004-09-12
    
    pub   1024D/FBB75451 2004-12-30
    uid                  Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com>
    
    pub   4096R/C0B21F32 2012-05-11
    uid                  Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>
    
    pub   4096R/EFE21092 2012-05-11
    uid                  Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>
    
    pub   4096R/0EBFCD88 2017-02-22
    uid                  Docker Release (CE deb) <docker@docker.com>
    sub   4096R/F273FCD8 2017-02-22
    
    pub   1024D/5072E1F5 2003-02-03 [expired: 2017-02-16]
    uid                  MySQL Release Engineering <mysql-build@oss.oracle.com>
    
    /etc/apt/trusted.gpg.d/chris-lea-node_js.gpg
    --------------------------------------------
    pub   1024R/C7917B12 2010-05-17
    uid                  Launchpad chrislea
    
    /etc/apt/trusted.gpg.d/ondrej-php.gpg
    -------------------------------------
    pub   1024R/E5267A6C 2009-01-26
    uid                  Launchpad PPA for Ondřej Surý

    删除mysql 的repository GPG key,删除命令如下:

    sudo apt-key del 5072E1F5

    删除完了之后,检查还有没有那个mysql的key
    没有了,执行命令

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 8C718D3B5072E1F5

    输出:

    root@iZ9:/var/www/html/gryphon# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 8C718D3B5072E1F5
    Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.RkicIHyEqq --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyring /etc/apt/trusted.gpg.d/chris-lea-node_js.gpg --keyring /etc/apt/trusted.gpg.d/ondrej-php.gpg --keyserver keyserver.ubuntu.com --recv 8C718D3B5072E1F5
    gpg: requesting key 5072E1F5 from hkp server keyserver.ubuntu.com
    gpg: key 5072E1F5: public key "MySQL Release Engineering <mysql-build@oss.oracle.com>" imported
    gpg: Total number processed: 1
    gpg:               imported: 1

    我们再次查看:apt-key list

    root@iZ94j7ehy5oZ:/var/www/html/gryphon# apt-key list
    /etc/apt/trusted.gpg
    --------------------
    pub   1024D/437D05B5 2004-09-12
    uid                  Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>
    sub   2048g/79164387 2004-09-12
    
    pub   1024D/FBB75451 2004-12-30
    uid                  Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com>
    
    pub   4096R/C0B21F32 2012-05-11
    uid                  Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>
    
    pub   4096R/EFE21092 2012-05-11
    uid                  Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>
    
    pub   4096R/0EBFCD88 2017-02-22
    uid                  Docker Release (CE deb) <docker@docker.com>
    sub   4096R/F273FCD8 2017-02-22
    
    pub   1024D/5072E1F5 2003-02-03 [expires: 2022-02-16]
    uid                  MySQL Release Engineering <mysql-build@oss.oracle.com>
    
    /etc/apt/trusted.gpg.d/chris-lea-node_js.gpg
    --------------------------------------------
    pub   1024R/C7917B12 2010-05-17
    uid                  Launchpad chrislea
    
    /etc/apt/trusted.gpg.d/ondrej-php.gpg
    -------------------------------------
    pub   1024R/E5267A6C 2009-01-26
    uid                  Launchpad PPA for Ondřej Surý

    我们可以看到,mysql 的过期时间已经变为 2022-02-06 了

    pub   1024D/5072E1F5 2003-02-03 [expires: 2022-02-16]
    uid                  MySQL Release Engineering <mysql-build@oss.oracle.com>

    然后我们再更新包:

    apt-get update
    欢迎关注微信公众号:大数据从业者
  • 相关阅读:
    .NET 客户端上传本地excel文件到服务器上,并在客户端显示
    C#实现数字字符串左补齐0的3种方法
    C# 输出pdf文件流在页面上显示
    ASP.NET 将数据生成PDF (二)
    asp.net生成PDF文件 (1)
    stl常用的查找算法
    stl中的transform()注意其与for_each的不同点(有无返回值)
    stl中的for_each() 函数的注意事项
    如何在VMware系统中的ubuntu16.04中建立与win7系统的共享文件夹
    关于linux中用vi新建立一个.c文件无法保存,显示E212错误的时候
  • 原文地址:https://www.cnblogs.com/felixzh/p/14490563.html
Copyright © 2020-2023  润新知