我的 Debian 服务器上有 php 7.0 / nginx。我想将其升级到至少 php 7.1。按照https://launchpad.net/~ondrej/+archive/ubuntu/php我遇到了很多问题。
groot@vps149861:/etc/apt# sudo apt-add-repository ppa:ondrej/nginx
password:
This branch follows latest NGINX Stable packages compiled against latest OpenSSL for HTTP/2 and TLS 1.3 support.
BUGS&FEATURES: This PPA now has a issue tracker: https://deb.sury.org/#bug-reporting
PLEASE READ: If you like my work and want to give me a little motivation, please consider donating: https://donate.sury.org
More info: https://launchpad.net/~ondrej/+archive/ubuntu/nginx
Press [ENTER] to continue or ctrl-c to cancel adding it
gpg: keybox '/tmp/tmpd49klpme/pubring.gpg' created
gpg: /tmp/tmpd49klpme/trustdb.gpg: trustdb created
gpg: key 4F4EA0AAE5267A6C: public key "Launchpad PPA for Ondřej Surý" imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: no valid OpenPGP data found.
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/usr/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 688, in addkey_func
func(**kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 386, in add_key
return apsk.add_ppa_signing_key()
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 273, in add_ppa_signing_key
cleanup(tmp_keyring_dir)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 234, in cleanup
shutil.rmtree(tmp_keyring_dir)
File "/usr/lib/python3.5/shutil.py", line 480, in rmtree
_rmtree_safe_fd(fd, path, onerror)
File "/usr/lib/python3.5/shutil.py", line 438, in _rmtree_safe_fd
onerror(os.unlink, fullname, sys.exc_info())
File "/usr/lib/python3.5/shutil.py", line 436, in _rmtree_safe_fd
os.unlink(name, dir_fd=topfd)
FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.extra'
groot@vps149861:/etc/apt# sudo apt-get update
Hit:1 http://security.debian.org stretch/updates InRelease
Ign:2 http://deb.debian.org/debian stretch InRelease
Hit:3 http://deb.debian.org/debian stretch-updates InRelease
Hit:4 http://deb.debian.org/debian stretch-backports InRelease
Hit:5 http://deb.debian.org/debian stretch Release
Hit:6 http://mirror.aarnet.edu.au/pub/MariaDB/repo/10.2/debian stretch InRelease
Hit:7 https://download.docker.com/linux/debian stretch InRelease
Ign:8 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco InRelease
Hit:10 https://apt.blobfolio.com/debian stretch InRelease
Get:11 http://ppa.launchpad.net/ondrej/php/ubuntu disco InRelease [20.8 kB]
Ign:11 http://ppa.launchpad.net/ondrej/php/ubuntu disco InRelease
Ign:12 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco Release
Get:13 http://ppa.launchpad.net/ondrej/php/ubuntu disco/main amd64 Packages [30.6 kB]
Get:14 http://ppa.launchpad.net/ondrej/php/ubuntu disco/main Translation-en [11.5 kB]
Ign:15 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main amd64 Packages
Ign:16 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main all Packages
Ign:17 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en
Ign:18 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en_US
Ign:15 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main amd64 Packages
Ign:16 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main all Packages
Ign:17 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en
Ign:18 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en_US
Ign:15 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main amd64 Packages
Ign:16 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main all Packages
Ign:17 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en
Ign:18 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en_US
Ign:15 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main amd64 Packages
Ign:16 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main all Packages
Ign:17 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en
Ign:18 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en_US
Ign:15 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main amd64 Packages
Ign:16 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main all Packages
Ign:17 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en
Ign:18 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en_US
Err:15 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main amd64 Packages
404 Not Found
Ign:16 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main all Packages
Ign:17 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en
Ign:18 http://ppa.launchpad.net/ondrej/nginx/ubuntu disco/main Translation-en_US
Fetched 62.9 kB in 16s (3,899 B/s)
Reading package lists... Done
W: GPG error: http://ppa.launchpad.net/ondrej/php/ubuntu disco InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
W: The repository 'http://ppa.launchpad.net/ondrej/php/ubuntu disco InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://ppa.launchpad.net/ondrej/nginx/ubuntu disco Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/ondrej/nginx/ubuntu/dists/disco/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
我意识到重要的一点可能是公钥密码 4F4EA0AAE5267A6C但是我该输入什么来修复该问题以便 apt-get update 能够正常工作?
答案1
您是否已按照 README.txt 中的说明添加了存储库PHP和Nginx?
本部分添加了DEB.SURY.ORG 自动签名密钥(与 Nginx 的密钥相同):
apt-get -y install apt-transport-https lsb-release ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
您的主要问题是您在 Debian 上使用 Ubuntu 存储库:
Hit:1 http://security.debian.org stretch/updates InRelease
Get:11 http://ppa.launchpad.net/ondrej/php/ubuntu disco InRelease [20.8 kB]
Get:13 http://ppa.launchpad.net/ondrej/php/ubuntu disco/main amd64 Packages [30.6 kB]
Get:14 http://ppa.launchpad.net/ondrej/php/ubuntu disco/main Translation-en [11.5 kB]