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
  • 70,465

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
  • 70,465
XiR_
  • 136
  • 5
  • Hi Sry by mistake type that but i was running apt-get install and i think its a error of apt so i'm not able to install anything – Harshit Girish Bhai Bhatt Dec 18 '17 at 13:01
  • check your apt sources. you could check/fix them using this site: https://repogen.simplylinux.ch/

    good luck

    – XiR_ Dec 18 '17 at 13:14
  • Hi This is showing Dependency error and when i'm try To install The dependency some other dependency came with same error So The error is not resolving any Way To Rebuild my dpkg/apt-get -as a fresh os – Harshit Girish Bhai Bhatt Dec 18 '17 at 13:19
2

Try using Aptitude to resolve dependencies:

sudo apt-get install aptitude
sudo aptitude install php7.1
Zanna
  • 70,465
Ruhul
  • 66