Recently, I tried to update uwsgi package on Ubuntu Xenial, but received an error about broken package. It looks like the mentioned package was pushed to the repository before its dependencies. This issue is thoroughly described in <a href=“https://bugs.launchpad.net/ubuntu/+source/uwsgi/+bug/1719363" target=_blank” rel=“external”>#1719363 bug report.

Affected linux distribution.

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.3 LTS
Release:	16.04
Codename:	xenial

Not satisfied libphp-embed dependency for the uwsgi-plugin-php package during upgrade process.

$ sudo apt-get upgrade 
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... 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:
 uwsgi-plugin-php : Depends: libphp-embed (>= 1:7.0+35ubuntu6.1~)
E: Broken packages

Available libphp-embed package versions.

$ apt-cache policy libphp-embed
libphp-embed:
  Installed: 1:7.0+35ubuntu6
  Candidate: 1:7.0+35ubuntu6
  Version table:
 *** 1:7.0+35ubuntu6 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status

Available uwsgi package versions.

$ apt-cache policy uwsgi
uwsgi:
  Installed: 2.0.12-5ubuntu3
  Candidate: 2.0.12-5ubuntu3.1
  Version table:
     2.0.12-5ubuntu3.1 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
 *** 2.0.12-5ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status

Simply pin current uwsgi version to fix this problem.

$ cat << EOF | sudo tee etc/apt/preferences.d/uwsgi
Package: uwsgi*
Pin: version 2.0.12-5ubuntu3
Pin-Priority: 1000
EOF

APT will now use the working version.

$ apt-cache policy uwsgi
uwsgi:
  Installed: 2.0.12-5ubuntu3
  Candidate: 2.0.12-5ubuntu3
  Version table:
     2.0.12-5ubuntu3.1 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
 *** 2.0.12-5ubuntu3 1000
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status

Be patient and stick with it till this issue get fixed.

$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Temporary fix implemented.