我上周在 Digital Ocean droplet 上的服务器上安装了 Ubuntu 16.04,从那时起,我无法更新或升级服务器上的任何东西。Ma 版本Linux 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
我在之后收到此错误sudo apt-get update
:
Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease [23.9 kB]
Ign:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease
Hit:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Err:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
Could not execute 'apt-key' to verify signature (is gnupg installed?)
Err:3 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Could not execute 'apt-key' to verify signature (is gnupg installed?)
Hit:7 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
Err:7 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
Could not execute 'apt-key' to verify signature (is gnupg installed?)
Hit:8 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease
Err:8 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease
Could not execute 'apt-key' to verify signature (is gnupg installed?)
Fetched 272 kB in 0s (363 kB/s)
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.ubuntu.com/ubuntu xenial-security InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: GPG error: https://apt.dockerproject.org/repo ubuntu-xenial Release: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: The repository 'https://apt.dockerproject.org/repo ubuntu-xenial Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://us.archive.ubuntu.com/ubuntu xenial InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease: Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial/InRelease Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease Could not execute 'apt-key' to verify signature (is gnupg installed?)
W: Some index files failed to download. They have been ignored, or old ones used instead.
我检查了apt-key
哪个在那里并且正在运行。
答案1
将权限改/tmp
回他们的默认设置对我有用:
sudo chmod 1777 /tmp
答案2
我在 Digital Ocean 的 Ubuntu droplet 上遇到了同样的问题(发行版升级后)。
只需在数字海洋管理网站上升级您的内核(是的,这很奇怪)。左侧菜单中有一个“内核”选项,您可以在其中选择新的内核映像。
就我而言,升级是从 3.x 到 4.x 系列
答案3
就我而言,我使用了 AppArmor 并启用了投诉模式sshd
。通过禁用它aa-disable /usr/sbin/sshd
并重新连接解决了我的问题。
答案4
我遇到了同样的问题,并通过降级到 15.10 中的 apt 版本来“修复”它。
就我而言,我做了以下事情:
sudo add-apt-repository 'deb http://archive.ubuntu.com/ubuntu wily-updates main'
sudo apt-get update # and ignore the errors
sudo aptitude install apt=1.0.10.2ubuntu2
并选择破坏性较小的选项。警告:选择错误的选项可能会从系统中删除重要的软件包,请谨慎操作。 我选择了以下选项:
The following actions will resolve these dependencies:
Remove the following packages:
1) libapt-inst2.0
2) libapt-pkg5.0
Install the following packages:
3) libapt-inst1.7 [1.0.10.2ubuntu2 (wily-updates)]
Downgrade the following packages:
4) apt-transport-https [1.2.10ubuntu1 (now, xenial) -> 1.0.10.2ubuntu2 (wily-updates)]
5) apt-utils [1.2.10ubuntu1 (now, xenial) -> 1.0.10.2ubuntu2 (wily-updates)]
6) aptitude [0.7.4-2ubuntu2 (now, xenial) -> 0.7.3-1ubuntu1.1 (wily-updates)]
7) aptitude-common [0.7.4-2ubuntu2 (now, xenial) -> 0.7.3-1ubuntu1.1 (wily-updates)]
8) python-apt [1.1.0~beta1build1 (now, xenial) -> 1.0.1ubuntu0.1 (wily-updates)]
9) python3-apt [1.1.0~beta1build1 (now, xenial) -> 1.0.1ubuntu0.1 (wily-updates)]
Leave the following dependencies unresolved:
10) libapt-pkg5.0 recommends apt (>= 1.2.10ubuntu1)
Accept this solution? [Y/n/q/?] Y