Cannot install php7.2-fpm on the latest Ubuntu “18.04.2 LTS (Bionic Beaver)”

Asked by Constantin Bugneac

Hi,

If I understood correctly PHP7.2 is available now on Ubuntu 18.04.
I cannot install neither php7.2-fpm nor php-fpm.

Note: I've run apt update to update the cache before.

# apt install php7.2-fpm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.2-fpm : Depends: php7.2-common (= 7.2.3-1ubuntu1) but 7.2.15-0ubuntu0.18.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.

or

# apt install php-fpm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php-fpm : Depends: php7.2-fpm but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Any ideas on how to sort out this ?

Thanks & Regards,
Constantin

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu php7.2 Edit question
Assignee:
No assignee Edit question
Solved by:
Constantin Bugneac
Solved:
Last query:
Last reply:
Revision history for this message
Constantin Bugneac (cb.worldfirst) said :
#1

If it helps:

# apt-cache policy php7.2
php7.2:
  Installed: 7.2.15-0ubuntu0.18.04.1
  Candidate: 7.2.15-0ubuntu0.18.04.1
  Version table:
 *** 7.2.15-0ubuntu0.18.04.1 500
        500 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     7.2.3-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

# apt-cache policy php7.2-common
php7.2-common:
  Installed: 7.2.15-0ubuntu0.18.04.1
  Candidate: 7.2.15-0ubuntu0.18.04.1
  Version table:
 *** 7.2.15-0ubuntu0.18.04.1 500
        500 http://archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     7.2.3-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

# apt-cache policy php7.2-fpm
php7.2-fpm:
  Installed: (none)
  Candidate: 7.2.3-1ubuntu1
  Version table:
     7.2.3-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages

Revision history for this message
Manfred Hampl (m-hampl) said :
#2

You probably are missing the bionic-security/universe and bionic-updates/universe repositories.

What is the output of the commands

uname -a
lsb_release -crid
cat -n /etc/apt/sources.list

Revision history for this message
Constantin Bugneac (cb.worldfirst) said :
#3

 uname -a
Linux vagrant 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

# lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic

 cat -n /etc/apt/sources.list
     1 deb http://archive.ubuntu.com/ubuntu bionic main
     2 deb http://archive.ubuntu.com/ubuntu bionic-security main
     3 deb http://archive.ubuntu.com/ubuntu bionic-updates main

 cat -n /etc/apt/sources.list.d/archive_ubuntu_com_ubuntu.list
     1 deb http://archive.ubuntu.com/ubuntu bionic multiverse
     2 deb http://archive.ubuntu.com/ubuntu bionic universe

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

Yes, it is what I assumed.

Edit the archive_ubuntu_com_ubuntu.list configuration file (e.g. with sudo gedit …) and add the lines

deb http://archive.ubuntu.com/ubuntu bionic-security multiverse
deb http://archive.ubuntu.com/ubuntu bionic-security universe
deb http://archive.ubuntu.com/ubuntu bionic-updates multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates universe

Then issue the command
sudo apt update
and finally try installing php7.2-fpm

Revision history for this message
Constantin Bugneac (cb.worldfirst) said :
#5

Many Thanks Manfred, it helped!

1. Should I remove something not necessary from my original list of repositories (just to avoid conflicts)?

2. Do you have a link/reference to documentation page describing what repos are available and should be included ?

Regards,
C

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

Documentation:
https://help.ubuntu.com/community/Repositories
https://help.ubuntu.com/community/Repositories/Ubuntu
https://gist.github.com/rhuancarlos/c4d3c0cf4550db5326dca8edf1e76800

There is nothing in your list of repositories what should be deleted. You can leave it as it is.
It is more the other way round, you could consider adding even more entries (namely backports and/or restricted), but that is not a must.

Revision history for this message
Constantin Bugneac (cb.worldfirst) said :
#7

Much appreciated Manfred.