zoukankan      html  css  js  c++  java
  • Ubuntu 18.04 apt-get update出现NO_PUBKEY错误的解决方法

    最近在VPS中使用apt-get update命令时,出现了如下的错误,形式如“W: GPG error: http://security.ubuntu.com trusty-security Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY XXXXX”

    该问题也会出现在Ubuntu其他的版本中,实际上在商家上线的系统模版中或多或少都有一些类似的细节错误,值得我们在使用中注意并修正。当然这一类的问题实际上并不算大,只是解决起来可能需要一些搜索工作。

    apt-get update返回NO_PUBKEY错误的解决方法

    报错代码如下:

    Err:5 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu bionic InRelease
      The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
    Fetched 23.3 kB in 9s (2,673 B/s)
    Reading package lists... Done
    W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
    W: Failed to fetch https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/dists/bionic/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
    W: Some index files failed to download. They have been ignored, or old ones used instead.

    解决办法:

    将公钥添加至服务器,运行如下命令解决:

    apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32

    添加成功后终端输出为:

    Executing: /tmp/apt-key-gpghome.4JQ9tOjCB7/gpg.1.sh --recv-keys --keyserver keyserver.ubuntu.com 3F01618A51312F3F
    gpg: key 3F01618A51312F3F: public key "GitLab B.V. (package repository signing key) <packages@gitlab.com>" imported
    gpg: Total number processed: 1
    gpg:               imported: 1

    这样再去sudo apt-get update就不会有问题了。

    参考文献:https://www.jb51.net/os/Ubuntu/169716.html

  • 相关阅读:
    Backbone Events 源码笔记
    IIS8集成模式下打开静态资源被aspx处理程序处理,StaticFileModule失效问题分析
    Orchard 与 ABP架构比较 (aspnetboilerplate)
    Orchard EventBus 事件总线及 IEventHandler作用
    Orchard 事件通知小坑
    推荐一个国内编程语言排名网站
    po_文件格式[转]
    关于poedit打开po文件乱码的问题
    JAVA和.NET工作流相关项目收集
    php里的二进制安全
  • 原文地址:https://www.cnblogs.com/xingyunqiu/p/12745371.html
Copyright © 2011-2022 走看看