尝试更新包时发生握手错误

尝试更新包时发生握手错误

运行时我得到以下输出sudo apt-get update

Ign https://repo.varnish-cache.org trusty Release   
Ign https://repo.varnish-cache.org trusty/varnish-4.0 amd64 Packages/DiffIndex
Ign https://repo.varnish-cache.org trusty/varnish-4.0 i386 Packages/DiffIndex
Ign https://repo.varnish-cache.org trusty/varnish-4.0 Translation-en_US        
Ign https://repo.varnish-cache.org trusty/varnish-4.0 Translation-en           
Err https://repo.varnish-cache.org trusty/varnish-4.0 amd64 Packages           
  gnutls_handshake() failed: Handshake failed
Err https://repo.varnish-cache.org trusty/varnish-4.0 i386 Packages            
  gnutls_handshake() failed: Handshake failed
Fetched 5,403 kB in 10s (506 kB/s)                                             
W: Failed to fetch https://repo.varnish-cache.org/ubuntu/dists/trusty/varnish-4.0/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://repo.varnish-cache.org/ubuntu/dists/trusty/varnish-4.0/binary-i386/Packages  gnutls_handshake() failed: Handshake failed

E: Some index files failed to download. They have been ignored, or old ones used instead.

这是什么意思?我该如何解决这个问题?

答案1

要修复,请删除老的Varnish-Cache 和损坏的 APT repo 源:

sudo apt-get purge varnish

sudo rm /etc/apt/sources.list.d/varnish*

sudo apt-key list | grep "varnish"

^(在左侧找到与 varnish-cache 匹配的 GPG‘KeyID’)

sudo apt-key del (Varnish-Cache GPG KeyID from above)

运行 apt update - 你应该不会再看到任何错误:

sudo apt-get update


如果您希望通过官方 Ubuntu repo 再次安装它:

sudo apt-get install varnish

看:https://varnish-cache.org/releases/install_debian.html


如果您希望安装最新版本或开发版本,请按照以下说明(或更新的指南)操作:

=>https://packagecloud.io/varnishcache/varnish5/install#bash-deb

答案2

这是一个 SSL 错误。

如果你进入主页,你会看到:

repo.varnish-cache.org 不再存在。

项目主页包含了关于在哪里获取发布版本、软件包等的完整详细信息。

如果您然后转到主页:http://varnish-cache.org/releases/

你会看见

Deb 和 RPM 存储库现已在 Packagecloud

Debian、Ubuntu、CentOS 和 Red Hat 的官方软件包现在位于 Packagecloud.io 的存储库中。repo.varnish-cache.org 存储库的用户必须将其主机更改为新的存储库配置。有关详细信息,请参阅以下有关发行版的部分。

浏览该页面最终会导向

https://packagecloud.io/varnishcache/varnish5/install

因此,最重要的是,您有一个 SSL 错误,因为 repo 不再存在,您需要更新您的 repos;)

答案3

我在 Ubuntu 14.04 上遇到了类似的问题。我有这个...

curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
printf "Package: *\nPin: origin apt.syncthing.net\nPin-Priority: 990\n" | sudo tee /etc/apt/preferences.d/syncthing
sudo apt-get update
sudo apt-get install -y syncthing

...这给了我这个错误...

W: Failed to fetch https://apt.syncthing.net/dists/syncthing/stable/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

我唯一需要做的就是将 改为https://apt.syncthing.net/使用http://apt.syncthing.net/http 而不是 https。这不太安全,但当你使用像 Ubuntu 14.04 这样的旧系统时,这是一个安装软件包的快速解决方案,因为这些旧系统没有某些较新的 APT 存储库希望客户端使用的所有最新 https 密码。

相关内容