验证签名错误,无法下载酒的索引文件,更换镜像也没有帮助。

当我运行sudo apt-get update时,出现了下面显示的错误。
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.winehq.org/wine-builds/ubuntu bionic InRelease: 
The following signatures couldn't be verified
 because the public key is not available: NO_PUBKEY 76F1A20FF987672F
W: Failed to fetch https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/InRelease
The following signatures couldn't be verified
 because the public key is not available: NO_PUBKEY 76F1A20FF987672F
W: Some index files failed to download. They have been ignored, or old ones used instead.

所以我按照this Ask Ubuntu answer的建议更换了我的镜像。然后我重新启动了电脑。但是当我执行sudo apt-get update时,仍然出现了相同的错误。
让我们尝试重新安装密钥。
$ wget -nc https://dl.winehq.org/wine-builds/Release.key && sudo apt-key add Release.key
File ‘Release.key’ already there; not retrieving. OK

我也可以顺便执行一下 ping -c3 archive.ubuntu.com 命令,我的丢包率是0%。还需要做些什么呢?

2看起来,新的酒更新使用的密钥与他们托管的Release.key不同。 - user3074620
1请使用代码格式化命令输出(就像命令一样),而不是引用格式。 - muru
6个回答

截至2018年12月19日08:07,有一个新的密钥文件,如此处所述。
下载新的存储库密钥并将其添加到受信任密钥列表中。
cd /tmp
wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key
sudo apt update

如@jason-hunter在评论中提到的,apt update会询问您是否接受仓库中的更改,而apt-get update会显示错误并失败。

请注意,在添加新的密钥文件后,最好使用apt update而不是apt-get update,因为它会提示您接受更改。
wget -nc https://dl.winehq.org/wine-builds/winehq.key && sudo apt-key add winehq.key && sudo apt update

2我还添加了软件源 sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main',这个解决方案有效。如上所述,您必须使用 sudo apt update 而不是 sudo apt-get updateapt 强制您明确接受,而 apt-get 则不会,并且会产生错误。如果您使用其他版本的 Ubuntu,可以在此处找到要添加的软件源 https://wiki.winehq.org/Ubuntu - Display name
我会考虑在开始时添加rm winehq.key或将文件保存到/temp。不管怎样,还是谢谢! - kcpr

检查https://dl.winehq.org/wine-builds/时,发现有一个新文件winehq.key。尝试使用它,因为它的指纹似乎与错误匹配:
# curl -sL "https://dl.winehq.org/wine-builds/Release.key" | gpg --dry-run --import --verbose
gpg: pub  rsa4096/818A435C5FCBF54A 2015-11-23  Sebastian Lackner (WineHQ packages) <sebastian@fds-team.de>
gpg: Total number processed: 1
# curl -sL "https://dl.winehq.org/wine-builds/winehq.key" | gpg --dry-run --import --verbose
gpg: pub  rsa3072/76F1A20FF987672F 2018-12-10  WineHQ packages <wine-devel@winehq.org>
gpg: key 76F1A20FF987672F: 1 signature not checked due to a missing key
gpg: Total number processed: 1

这个命令对我来说有效:
wget -nc https://dl.winehq.org/wine-builds/winehq.key && apt-key add winehq.key

我最近也遇到了同样的错误。
Err:3 https://dl.winehq.org/wine-builds/ubuntu bionic InRelease                
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 76F1A20FF987672F

事实证明,需要将公钥添加到我的主机中。 添加该密钥是在此处看到的密钥的最后8位数字F987672F。 因此,将其添加到以下内容中以将密钥添加到您的主机中:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv F987672F

希望这有所帮助!

我使用Docker来运行Node、Java、Angular和Electron。这些都能正常工作。
FROM node:16.15.0

WORKDIR /work
COPY package.json .

RUN apt update
RUN apt-get -y install zip unzip

# node_modules witch angular and electron
RUN npm install -g n @angular/cli electron electron-builder

# JAVA
RUN apt-get -y install default-jre
RUN apt install openjdk-11-jre-headless 

# Wine (Wine32)
RUN apt install -y software-properties-common
RUN dpkg --add-architecture i386
RUN wget -nc https://dl.winehq.org/wine-builds/winehq.key
RUN apt-key add winehq.key
RUN add-apt-repository 'deb https://dl.winehq.org/wine-builds/debian/ buster main'
RUN apt update
RUN apt -y install --install-recommends winehq-stable

EXPOSE 3002