Fix apt-get update “the following signatures couldn’t be verified because the public key is not available”

There are times when running apt-get update in Ubuntu will result in error messages such as the following:

[[email protected] ~]$ sudo apt-get update
Ign http://security.ubuntu.com trusty-security InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
...
Fetched 21.9 MB in 14s (1,537 kB/s)
Reading package lists... Done
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 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://archive.canonical.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://archive.ubuntu.com trusty Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
W: GPG error: http://archive.ubuntu.com trusty-updates Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32
[[email protected] ~]$

If these errors aren’t fixed, apt will have problems when installing or upgrading packages. For example:

[[email protected] ~]$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Calculating upgrade... Done
...
E: Some packages could not be authenticated
[[email protected] ~]$

The apt packaging system has a set of trusted keys that determine whether a package can be authenticated and therefore trusted to be installed on the system. Sometimes the system does not have all the keys it needs and runs into this issue. Fortunately, there is a quick fix. Each key that is listed as missing needs to be added to the apt key manager so that it can authenticate the packages.

Looking at the error above, apt is telling us that the following keys are missing: 40976EAF437D05B5 and 3B4FE6ACC0B21F32. Notice that these are listed multiple times. Each unique key will only need to be added once.

Read more

简单搭建 Zerotier Moon 为虚拟网络加速

Zerotier 是一款开源工具,可以用来构建点对点(P2P)虚拟网络。比如你的女友不让你去网吧玩游戏,这时候你就可以建立一个 Zerotier 点对点虚拟网络,把你和朋友的家的电脑都加入到这个虚拟网络中,然后你们就可以像在网吧里一样联机玩耍了。

Zerotier 的基本用法可以参考NAS之旅第10期视频,这里我们要分享的是如何自己搭建 Zerotier Moon,加速 Zerotier-One 的连接,让虚拟网络更稳定的运行。

Read more

linux screen的用法

linux screen的用法

大家在初次接触linuxVPS时,会发现linux操作和windows操作太不相同的,windows都是图形操作界面,而linux一般是命令行操作,当然,linux也有图形操作界面,但是我们在将vps作为网络生产环境时,安装图形界面不光费时费力,更费vps那少的可怜的系统资源,所以,还是命令行吧,可是命令行只有一个,linux下编译命令一般执行也比较慢,如编译军哥的lnmp,少则半小时二十分钟,多则三小时五小时,一旦断开,正在编译的软件也就完了,这很不符合偶们的折腾精神,难道就木有个解决方法?当然有,那就是screen。

一、神马是screen?

Screen是一个可以在多个进程之间多路复用一个物理终端的全屏窗口管理器。Screen中有会话的概念,用户可以在一个会话中创建多个screen窗口,在每一个screen窗口中就像操作一个真实的telnet/SSH连接窗口那样。

通俗的讲,screen命令用于新建一个或多个“命令行窗口”,在新建的这“窗口”中,可以执行命令;每个“窗口”都是独立并行的。

Read more

Openwrt路由通过Zerotier组网实现异地内网互访

最近有三地组网需求,使相互能内网访问。此方案还可以通过OpenVPN来实现,本文只记录一下本次使用的Zerotier方案。

关于Zerotier方案的优缺点,阅读本文的同学自行搜索一下,此处不做赘述了。

本方案以Openwrt 18.06-RC2为例子做说明,其他版本理论类似,有需求的同学自己实验即可。

至于怎么注册zerotier账户,此处也不做说明。

Zerotier地址:https://my.zerotier.com/

Read more