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

Ubuntu/GNOME 一些好用的扩展

shell扩展

需先安装有gnome-tweak。

可在 https://extensions.gnome.org/ 中下载安装.注册该网站,浏览器会提示安装相应扩展。

archlinux可以在aur中搜索gnome-shell-extension的关键字查找(以”插件名+shell“进行搜索,如yaourt weather shell)。

一些扩展(部分扩展在gnome-shell-extensions这个包里面):

Read more

How to Disable or Uninstall Synology Universal Search

Starting with DSM version 6.1 Synology has removed File Station from the core and swapped the Search functionality from File Station with its own package called “Universal Search“. I’ve noticed some users, myself included, don’t use this package and don’t even want it in their Synology; however, it cannot be disabled or uninstalled via Package Center.

Universal search package

Read more

[Howto] Use wayland with propietary nvidia drivers

Wayland does not play well with proprietary drivers. Currently the biggest issue is that nvidia does currently not support Xwayland properly, so apps that require it get software rendering. This includes most games, which are the most common use case for proprietary nvidia drivers. This is why gnome automatically disables Wayland if you have nvidia.

However, if this does not deter you, you can use Wayland with nvidia drivers. Here is how to do it:

  1. Edit the /etc/gdm/custom.conf file and comment out the line WaylandEnable=false. The correct file will then look something like this:
    
    
    # GDM configuration storage
    daemon]
    # Uncomment the line below to force the login screen to use Xorg
    #WaylandEnable=false
    
    [security]
    
    [xdmcp]
    
    [chooser]
    
    [debug]
    # Uncomment the line below to turn on debugging
    #Enable=true
    
  2. Now for the nvidia specific part: edit the file /usr/lib/udev/rules.d/61-gdm.rules and comment out the lines that disable wayland for nvidia. Note that this file gets overwritten by updates. The correct file looks something like this:
    
    # disable Wayland on Hi1710 chipsets
    ATTR{vendor}=="0x19e5", ATTR{device}=="0x1711", RUN+="/usr/lib/gdm-disable-wayland"
    # disable Wayland when using the proprietary nvidia driver
    #DRIVER=="nvidia", RUN+="/usr/lib/gdm-disable-wayland"
    # disable Wayland if modesetting is disabled
    #IMPORT{cmdline}="nomodeset", RUN+="/usr/lib/gdm-disable-wayland"
    
  3. Enable modesetting for nvdia drivers. Follow the instructions in the Arch wiki 5:
    • Add the modules nvidia , nvidia_modeset , nvidia_uvm and nvidia_drm to /etc/mkinitcpio.conf and run the command sudo mkinitcpio -P
    • Add the kernel parameter nvidia-drm.modeset=1 to /etc/default/grub and run the command sudo update-grub
  4. Reboot
  5. Profit. Congratulations, you should now be running gnome with wayland despite propietary nvidia drivers!

https://forum.manjaro.org/t/howto-use-wayland-with-propietary-nvidia-drivers/36130

为Debian 10升级Linux Kernel 5.x

目前 Debian 10 自带的内核版本为 4.19,可能由于种种原因…比如不升级手痒,十分希望体验一下新版内核,这篇文章可以指导你如何正确的查询并安装新版内核。
以下方法同时也适用于未来以及先前的 Debian 版本,步骤一致,唯一的区别是将文中的 buster-backports 中的代号更换为你正在使用的系统的代号。

Read more

win10 WSL2: docker, systemd, etc

背景

由于新款Mac性价比走低,近期转为使用Windows作为主力开发系统。但是在开发过程中需要上Linux测试,或者说部署一些服务,例如MySQL,Nexus OSS等。本人又是一个Docker重度依赖者。之前一直是长期在Windows下启动一个Linux虚拟机辅助开发操作。占用大量磁盘内存资源不说,操作和维护也极为繁琐。

直到近期了解到Win10 2004正式版版本支持WSL2,问题得到了完美的解决。WSL2相比WSL1来说可以完美支持Docker。与WSL1的模拟Linux API不同的是,WSL2采用在Hyper-V虚拟机中运行的方案。可以说WSL2和原汁原味的Linux已经十分接近。本人实验了一番,安装部署成功,将整个步骤分享给大家。

Read more