1.问题在Ubuntu环境下使用apt-getupdate更新包资源时出现如下错误:ignhttp://repo.mysql.comtrusty/mysql-toolsTranslation-enFetched3,164Bin1min42s(30B/s)Readingpackagelists...DoneW:GPGerror:http://repo.mysql.comtrustyInRelease:Thefollowingsignatureswereinvalid:KEYEXPIRED1487236823KEYEXPIRED1487236823KEYEXPIRED1487236823从报错信息来看,签名参数过期,需要先删除再更新。2.先查看执行命令:apt-keylistroot@iZ9:/var/www/html/gryphon#apt-keylist/etc/apt/trusted.gpg-------------------pub1024D/437D05B52004-09-12uidUbuntu存档自动签名密钥sub2048g/791643872004-09-12pub1024D/FBB754512004-12-30uidUbuntuCD映像自动键控签名pub4096R/C0B21F322012-05-11uidUbuntu存档自动签名密钥(2012)pub4096R/EFE210922012-05-11uidUbuntuCD映像自动签名密钥(2012)pub4096R/0EBFCD882017-02-22uidDockerRelease(CEdeb)sub4096R/F273FCD82017-02-22pub1024D/5072E1F52003-02-03[已过期:2017-02-16]uidMySQL发布工程/etc/apt/trusted.gpg.d/chris-lea-node_js.gpg-----------------------------------------pub1024R/C7917B122010-05-17uidLaunchpadchrislea/etc/apt/trusted.gpg.d/ondrej-php.gpg-------------------------------------pub1024R/E5267A6C2009-01-26uidLaunchpadPPAforOnd?ejSury删除mysql的repositoryGPGkey,删除命令如下:sudoapt-keydel5072E1F5删除后查看mysqlkey是否消失,执行命令:sudoapt-keyadv--keyserverkeyserver.ubuntu.com--recv8C718D3B5072E1F5输出:root@iZ9:/var/www/html/gryphon#sudoapt-keyadv--keyserverkeyserver.ubuntu.com--recv8C718D3B5072E1F5正在执行:gpg--ignore-time-conflict--no-options--no-default-keyring--homedir/tmp/tmp.RkicIHyEqq--no-auto-check-trustdb--trust-modelalways--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--keyserverkeyserver.ubuntu.com--recv8C718D3B5072E1F5gpg:从hkp服务器请求密钥5072E1F5keyserver.ubuntu.comgpg:密钥5072E1F5:公钥“MySQLReleaseEngineering"importedgpg:Totalnumberprocessed:1gpg:imported:1我们再次查看:apt-keylistroot@iZ94j7ehy5oZ:/var/www/html/gryphon#apt-keylist/etc/apt/trusted.gpg--------------------pub1024D/437D05B52004-09-12uidUbuntu存档自动签名密钥sub2048g/791643872004-09-12pub1024D/FBB754512004-12-30uidUbuntuCD映像自动签名密钥pub4096R/C0B21F322012-05-11uidUbuntu存档自动签名密钥(2012)pub4096R/EFE210922012-05-11uidUbuntuCD映像自动签名密钥(2012)pub4096R/0EBFCD882017-02-22uidDockerRelease(CEdeb)sub4096R/F273FCD82017-02-22pub1024D/5072E1F52003-02-03[expires:2022-02-16]uidMySQLRelease工程/etc/apt/trusted.gpg.d/chris-lea-node_js.gpg-------------------------------------------pub1024R/C7917B122010-05-17uidLaunchpadchrislea/etc/apt/trusted.gpg.d/ondrej-php。gpg------------------------------------pub1024R/E5267A6C2009-01-26uidLaunchpadPPAforOnd?ejSury可以看到mysql的过期时间变成了2022-02-06pub1024D/5072E1F52003-02-03[expires:2022-02-16]uidMySQLReleaseEngineering<mysql-build@oss.oracle.com>然后我们更新包:apt-getupdate