我想更新虚拟机上的 PHP 版本,为此,我必须在计算引擎(谷歌云平台)中的虚拟机上运行 sudo apt-get update,但我不断收到一条错误消息,提示“公钥不可用”
这是我的环境:
Linux wordpress-1-vm 4.9.0-5-amd64 #1 SMP Debian 4.9.65-3+deb9u2 (2018-01-04) x86_64 GNU/Linux
以下是我收到的错误:
Ign:1 http://ppa.launchpad.net/ondrej/php/ubuntu hirsute InRelease Err:2 http://ppa.launchpad.net/ondrej/php/ubuntu hirsute Release 404 Not Found Reading package lists... Done E: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu hirsute Release' does not have a Release file. 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
您需要添加 debia DPA 而不是 Ubutnu PPA,然后导入 gpg 密钥(以解决 apt-secure 错误)。
/etc/apt/sources.list
从您的或 下删除 Sury PPA /etc/apt/sources.list.d/
。
sudo apt -y install apt-transport-https lsb-release ca-certificates curl
sudo curl -sSL -o /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update