0

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

marked as duplicate by karel, Eric Carvalho, Zanna, Charles Green, David Foerster Dec 19 '17 at 17:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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/

  • 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: 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
1

Try using Aptitude to resolve dependencies:

sudo apt-get install aptitude
sudo aptitude install php7.1
  • Hi I Don't know how much package are unheld and Broken So apt-get Don't make me to install anything ......... – Harshit Girish Bhai Bhatt Dec 19 '17 at 5:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.