php - Install redis extension for php 7.4 on Debian server
问题描述
I'd like to install php7.4-redis on my debian server. My php is 7.4 version.
When I run the "sudo apt install php7.4-redis" command , it shows 404 not found so I can't finish my setting.
However , I found the page has other version : php7.4-redis version
I've run command "sudo apt-get update" to update the repository but why am I still getting the 404 error?
sudo apt install php7.4-redis
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
php7.4-igbinary
The following NEW packages will be installed:
php7.4-igbinary php7.4-redis
0 upgraded, 2 newly installed, 0 to remove and 70 not upgraded.
Need to get 142 kB/202 kB of archives.
After this operation, 848 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 https://packages.sury.org/php stretch/main amd64 php7.4-redis amd64 5.3.2+4.3.0-7+0~20210228.34+debian9~1.gbp893bd4
404 Not Found
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php-redis/php7.4-redis_5.3.2+4.3.0-7+0~20210228.34+debian9~1.gbp893bd4_amd64.deb 404 Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
解决方案
尝试运行apt update
,然后它应该可以工作。
APT 在运行时会在本地缓存每个存储库中可用的包apt update
。如果你安装一个包,apt 将使用这个缓存。但是,当服务器上的软件包更新并且旧版本被删除时,apt 将尝试检索不再存在的文件。此日志输出表明了这一点:
404 Not Found
E: Failed to fetch https://packages.sury.org/php/pool/main/p/php-redis/php7.4-redis_5.3.2+4.3.0-7+0~20210228.34+debian9~1.gbp893bd4_amd64.deb 404 Not Found
如果您查看repos 列表,您的版本5.3.2+4.3.0-7+0~20210228.34+debian9~1.gbp893bd4
明显丢失。因此,经过一个apt update
apt 后就会知道从哪里加载包。
编辑:您的系统上有一个来自 php sury 的旧签名密钥,因此无法更新 repo 并且无法获取要下载的当前版本。这是一个已知问题,我在所有主机上都遇到过。
在链接的 GitHub 线程中,建议的修复是简单地运行这些命令(由 stefanux 发布):
$ apt-key del 95BD4743 # If this throws an error about the key not being present, it's fine
$ wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
$ apt-get update
现在你应该可以安装 redis 包了。
推荐阅读
- python - Beautifulsoup 按其类名提取 div
- python - 如何在 R 或 Python 语言中以状态空间形式估计 GARCH-M?
- javascript - 用于 slug url 的 Next.js 路由,例如 site.com/username
- ssh - 手动应答 SSH 质询响应身份验证
- sql - 尽管 Main Line 在标准中为 True,但在 NetSuite 中保存的搜索会为每个供应商账单返回多行
- sql - postgresql中group by的奇怪行为
- javascript - 搜索 objects.shortName 数组以及嵌套的对象数组
- python - 如何打印存储在列表中的对象的值
- r - R认为积分可能是发散的
- discord.py - 搜索会员功能