无法在ubuntu上安装php7
我想在Ubuntu中安装php7或7.1,但我不能 我尝试使用以下代码:无法在ubuntu上安装php7,php,ubuntu,Php,Ubuntu,我想在Ubuntu中安装php7或7.1,但我不能 我尝试使用以下代码: sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt-get install -y php7.1 这就是结果: sudo: unable to resolve host myvps Reading package lists... Done Building dependency tree Reading state informat
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install -y php7.1
这就是结果:
sudo: unable to resolve host myvps
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.1
E: Couldn't find any package by regex 'php7.1'
也适用于PHP7.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.0
E: Couldn't find any package by regex 'php7.0'
但我知道我可以安装php5,但我不想!
se本次推荐的结果php-v
root@myvps:~# php -v
The program 'php' is currently not installed. You can install it by typing:
apt-get install php5-cli
以下是我的ubuntu信息:
root@myvps:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid
怎么了?有可能解决此问题吗?尝试不添加任何存储库
sudo apt-get install php7.0
所有的代码都是正确的,但是我们需要注意内核发布生命的结束,它是如此重要 我的问题就在这里 对于解决方案,我们有2个选项:
- 第一次升级内核版本(推荐)
- 第二次使用(自担风险)
sudo-apt-cache-search php7.0-
?尝试sudo-apt-cache-search php7
以查找确切的软件包名称。`sudo-apt-get-install-php7.0`这是正确的,但不仅仅适用于此vps
现实我不知道为什么,我也重新安装了os
,尝试后没有任何结果!我投票结束这个问题,因为它是关于包管理而不是编程的。请尝试使用有问题的软件包E:无法通过regex'php7.0'找到任何软件包您的ubuntu版本现在已不受支持,请更新您的ubuntu,然后重试。