1

When I'm running the following command I got a error:

$ sudo apt-get update php7.1
The following packages have unmet dependencies:
 php7.1 : Depends: libapache2-mod-php7.1 but it is not going to be installed or
                   php7.1-fpm but it is not going to be installed or
                   php7.1-cgi but it is not going to be installed
          Depends: php7.1-common but it is not going to be installed
Zanna
  • 72,312

2 Answers2

2

Your command is wrong and won't work. It should be apt-get install <package> not apt-get update <package> as update doesn't accept any parameter.

Besides that, I don't know which Ubuntu version are you using, but on 16.04, php7.1 is not available; the version in repositories is php7.0. Thus, I assume you have modified your APT sources and, though they have php7.1 available in a source you have added, some of its dependencies are not. I guess you have to add sources for the php7.1-common and php7.1-cgi or libapache2-mod-php7.1, or to avoid further problems, remove any repository or PPA that is causing the conflict.

Take a look at https://tecadmin.net/install-php-7-on-ubuntu/

Zanna
  • 72,312
XiR_
  • 136
  • 5
2

Try using Aptitude to resolve dependencies:

sudo apt-get install aptitude
sudo aptitude install php7.1
Zanna
  • 72,312
Ruhul
  • 76
  • 3