E: Unable to locate package php7.2-common 是什么原因?

1.56K 浏览服务器运维安装PHP

E: Unable to locate package php7.2-common 是什么原因?

第一次学习Magento,照着Magento2实战来操作,

服务器购买的是香港VPS 2CPC 4G 60G 5M Ubuntu-20.04.1-x64

通过putty登录服务器后;依次执行以下命令:

sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get -y install curl nano git
sudo apt install unzip

sudo apt-get install nginx

sudo systemctl start nginx

sudo apt install php7.2-common php7.2-cli php7.2-fpm php7.2-opcache php7.2-gd php7.2-mysql php7.2-curl php7.2-intl php7.2-xsl php7.2-mbstring php7.2-zip php7.2-bcmath php7.2-soap php7.2-fileinfo php7.2-imagick php7.2-redis

提示下面信息:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.2-common
E: Unable to locate package php7.2-cli
E: Unable to locate package php7.2-fpm
E: Unable to locate package php7.2-opcache
E: Unable to locate package php7.2-gd
E: Unable to locate package php7.2-mysql
E: Unable to locate package php7.2-curl
E: Unable to locate package php7.2-intl
E: Unable to locate package php7.2-xsl
E: Unable to locate package php7.2-mbstring
E: Unable to locate package php7.2-zip
E: Unable to locate package php7.2-bcmath
E: Unable to locate package php7.2-soap
E: Unable to locate package php7.2-fileinfo
E: Unable to locate package php7.2-imagick
E: Unable to locate package php7.2-redis

不知这个要怎么解决?

更改状态以发布

我在想,是不是前面几部,有些我不需要执行命令?默认安装的Ubuntu已经安装了了一些东西

0

应该是你服务器系统默认源没有php7.2的库,可能只有7.4的。

你输入命令看有没有这个库

apt-cache pkgnames | grep php7.2

如果没有的话 需要第三方源安装

sudo add-apt-repository ppa:ondrej/php
sudo apt install php7.2-common php7.2-cli php7.2-fpm php7.2-opcache php7.2-gd php7.2-mysql php7.2-curl php7.2-intl php7.2-xsl php7.2-mbstring php7.2-zip php7.2-bcmath php7.2-soap php7.2-fileinfo php7.2-imagick php7.2-redis
发表新评论

输入 apt-cache pkgnames | grep php7.2 后,啥 也没有

root@C20211125097891:~# apt-cache pkgnames | grep php7.2
root@C20211125097891:~#

sudo add-apt-repository ppa:ondrej/php
sudo apt install php7.2-common php7.2-cli php7.2-fpm php7.2-opcache php7.2-gd php7.2-mysql php7.2-curl php7.2-intl php7.2-xsl php7.2-mbstring php7.2-zip php7.2-bcmath php7.2-soap php7.2-fileinfo php7.2-imagick php7.2-redis
按照上执行后,可以了,已经进入下一步,非常感谢管理员

0