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

  • 相关阅读:
    论文摘记 2017.4.6-4.9
    P4 PI库安装
    Markdown中的表格
    Easy install ryu
    《重构网络-SDN架构与实现》阅读随笔
    解决Github Desktop Repo publish 失败问题
    解决 "OperationalError: (sqlite3.OperationalError) no such table: ..."问题
    初始化 Flask 虚拟环境 命令
    Flask: socket.error: [Errno 48] Address already in use 问题
    【转】TCP端口号记录
  • 原文地址:https://www.cnblogs.com/xingyunqiu/p/12745371.html
Copyright © 2011-2022 走看看