Я перепробовал все: от apt-get -f install до sudo apt-get purge linux-headers* до sudo purge-old-kernels и, похоже, ничто не помогло мне преодолеть эту ошибку после следующей команды или любой команды sudo apt-get install :

sudo apt-get install php-curl php-gd php-mbstring php-mcrypt php-xml php-xmlrpc

Reading package lists... Done
Building dependency tree
Reading state information... Done

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:

 linux-headers-generic : Depends: linux-headers-4.4.0-122-generic but it is not going to be installed
 php-xmlrpc : Depends: php7.0-xmlrpc but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

У меня есть эта версия Ubuntu:

lsb_release -a

No LSB modules are available.
Distributor ID: Ubuntu  
Description:    Ubuntu 16.04.4 LTS 
Release:        16.04
Codename:       xenial

Также, если это поможет:

sudo dpkg --configure -a

dpkg: dependency problems prevent configuration of linux-headers-generic:
 linux-headers-generic depends on linux-headers-4.4.0-122-generic; however:
  Package linux-headers-4.4.0-122-generic is not installed.

dpkg: error processing package linux-headers-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-headers-virtual:
 linux-headers-virtual depends on linux-headers-generic (= 4.4.0.122.128); however:
  Package linux-headers-generic is not configured yet.

dpkg: error processing package linux-headers-virtual (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-virtual:
 linux-virtual depends on linux-headers-virtual (= 4.4.0.122.128); however:
  Package linux-headers-virtual is not configured yet.

dpkg: error processing package linux-virtual (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-headers-generic
 linux-headers-virtual
 linux-virtual

0