
我想更新我的虛擬機器上的 PHP 版本,為此,我必須在計算引擎(Google雲端平台)中的虛擬機器上運行 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