无法在Ubuntu上获取sudo更新

时间:2019-01-27 17:00:33

标签: ubuntu-18.04

我的18.04 Ubuntu服务器出现问题。

当我尝试运行“ sudo apt-get update”时,我得到了它(代码1)

当我尝试为mastodon(joinmastodon.org)启动某些服务时,我也收到此错误(代码2)

代码1

root@dedi-par-72088:~# sudo apt-get update
Hit:1 http://mirrors.online.net/ubuntu bionic InRelease                        
Hit:2 http://mirrors.online.net/ubuntu bionic-updates InRelease                
Hit:3 http://mirrors.online.net/ubuntu bionic-backports InRelease              
Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease                        
Hit:5 http://ppa.launchpad.net/certbot/certbot/ubuntu bionic InRelease         
Hit:6 http://security.ubuntu.com/ubuntu bionic-security InRelease              
Hit:7 https://deb.nodesource.com/node_8.x bionic InRelease                     
Get:8 https://dl.yarnpkg.com/debian stable InRelease [13.3 kB]                 
Err:8 https://dl.yarnpkg.com/debian stable InRelease                      
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
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://dl.yarnpkg.com/debian stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
W: Failed to fetch https://dl.yarnpkg.com/debian/dists/stable/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23E7166788B63E1E
W: Some index files failed to download. They have been ignored, or old ones used instead.

代码2

Failed to start mastodon-web.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status mastodon-web.service' for details.
Failed to start mastodon-sidekiq.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status mastodon-sidekiq.service' for details.
Failed to start mastodon-streaming.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status mastodon-streaming.service' for details

代码2.1

mastodon@dedi-par-72088:~$ systemctl status mastodon-streaming.service
● mastodon-streaming.service - mastodon-streaming
   Loaded: loaded (/etc/systemd/system/mastodon-streaming.service; disabled; vendor preset: enabl
   Active: inactive (dead)

代码2.2

mastodon@dedi-par-72088:~$ systemctl enable mastodon-*
Failed to enable unit: The name org.freedesktop.PolicyKit1 was not provided by any .service files

我认为这是网络问题,但我不知道如何解决。 预先谢谢你。

2 个答案:

答案 0 :(得分:0)

代码1中的“ apt-get更新”问题是您错过了公钥23E7166788B63E1E。 您可以通过执行以下操作将此密钥添加到密钥环:

sudo apt-key adv --recv-key 23E7166788B63E1E

它将显示以下内容:

Executing: /tmp/apt-key-gpghome.6KxIWRrerk/gpg.1.sh --recv-key 23E7166788B63E1E
gpg: key 1646B01B86E50310: public key "Yarn Packaging <yarn@dan.cx>" imported
gpg: Total number processed: 1
gpg:               imported: 1

现在,您可以运行“ apt-get更新”或“ apt更新”,它还将获取https://dl.yarnpkg.com/debian/dists/stable/InRelease的索引。

答案 1 :(得分:0)

为纱线运行添加最新密钥

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -