每当我尝试运行软件更新程序时,我都会收到错误“无法下载存储库。请检查您的互联网连接。”并且每当我运行时sudo apt update
我都会收到错误
Get:6 https://packages.riot.im/debian default InRelease [2,892 B]
Err:6 https://packages.riot.im/debian default InRelease
The following signatures were invalid: EXPKEYSIG C2850B265AC085BD riot.im packages <[email protected]>
Reading package lists... Done
W: GPG error: https://packages.riot.im/debian default InRelease: The following signatures were invalid: EXPKEYSIG C2850B265AC085BD riot.im packages <[email protected]>
E: The repository 'https://packages.riot.im/debian default InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.`
答案1
您必须使用以下命令更新存储库 GPG 密钥
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C2850B265AC085BD
wget -q -O - https://packages.riot.im/element-release-key.gpg | sudo apt-key add -
wget -q -O - https://packages.riot.im/element-release-key-2020.gpg | sudo apt-key add -
wget -q -O - https://packages.riot.im/riot-release-key.gpg | sudo apt-key add -
然后将所有具有新依赖项的更新安装到当前系统
sudo apt-get update
sudo apt-get dist-upgrade
答案2
$ sudo ls -la /usr/share/keyrings/ | grep riot
-rw-r--r-- 1 root root 2887 Apr 16 2019 riot-im-archive-keyring.gpg
$ sudo rm /usr/share/keyrings/riot-im-archive-keyring.gpg
$ sudo wget -O /usr/share/keyrings/riot-im-archive-keyring.gpg https://packages.riot.im/debian/riot-im-archive-keyring.gpg
$ echo "deb [signed-by=/usr/share/keyrings/riot-im-archive-keyring.gpg] https://packages.riot.im/debian/ default main" | sudo tee /etc/apt/sources.list.d/riot-im.list