依存関係が満たされていないため、Ubuntu 16にphp-memcachedをインストールできません。

依存関係が満たされていないため、Ubuntu 16にphp-memcachedをインストールできません。

私は3つのWebサーバーを管理しており、すべてUbuntu 16.04を実行しています。現在、サーバーを18.04または20.04にアップグレードする前に、php-memcacheからphp-memcachedに移行しようとしています。

正常にインストールしましたPHP-memcached3つのWebサーバーのうちの1つでは、他の2つのサーバーで依存関係エラーが発生します。

# apt-get install php-memcached

[...]
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 create or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
php-memcached: Depends: php-common (>= 1:7.0+33~) but it is not going to be installed

Depends: phpapi-20151012
E: Unable to correct problems, you have held broken packages.

update->dist-upgradeを試して再起動しようとしましたが、問題は解決されませんでした。

以下に基づくストレージは次のとおりですapt-get update

# apt-get update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease                            
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Fetched 325 kB in 0s (364 kB/s)             

問題はphpapi-20151012にあるようです。

# apt-get -o Debug::pkgProblemResolver=yes install phpapi-20151012
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package phpapi-20151012 is a virtual package provided by:
  php7.0-phpdbg 7.0.33-0ubuntu0.16.04.15
  php7.0-fpm 7.0.33-0ubuntu0.16.04.15
  libphp7.0-embed 7.0.33-0ubuntu0.16.04.15
  php7.0-cli 7.0.33-0ubuntu0.16.04.15
  php7.0-cgi 7.0.33-0ubuntu0.16.04.15
  libapache2-mod-php7.0 7.0.33-0ubuntu0.16.04.15
You should explicitly select one to install.

E: Package 'phpapi-20151012' has no installation candidate

私が理解したところによれば、上記のメッセージphpapi-20151012は、リストされているパッケージの1つと一緒に提供されるべきです。 2つをインストールしましたが、まだphpapiはありません。だから私が持っていないものをインストールしてみましたが、それも機能しませんでした。

php-commonパッケージには問題がないようです。

# apt-get -o Debug::pkgProblemResolver=yes install php-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
php-common is already the newest version (1:62+ubuntu14.04.1+deb.sury.org+1).
Starting pkgProblemResolver with broken count: 0
Starting 2 pkgProblemResolver with broken count: 0
Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

また、PHP 7.1パッケージはUbuntu 14でそのまま残ることがわかりました。

php7.1-cli/now 7.1.19-1+ubuntu14.04.1+deb.sury.org+1 amd64 [installed,local]
php7.1-common/now 7.1.19-1+ubuntu14.04.1+deb.sury.org+1 amd64 [installed,local]
php7.1-json/now 7.1.19-1+ubuntu14.04.1+deb.sury.org+1 amd64 [installed,local]
php7.1-opcache/now 7.1.19-1+ubuntu14.04.1+deb.sury.org+1 amd64 [installed,local]
php7.1-readline/now 7.1.19-1+ubuntu14.04.1+deb.sury.org+1 amd64 [installed,local]

Apacheはphp 7.0を使用し、cliは7.1を使用しています。まず、php cliを7.0にダウングレードしました。

# update-alternatives --config php
There are 3 choices for the alternative php (providing /usr/bin/php).

  Selection    Path             Priority   Status
------------------------------------------------------------
* 0            /usr/bin/php7.1   71        auto mode
  1            /usr/bin/php5.6   56        manual mode
  2            /usr/bin/php7.0   70        manual mode
  3            /usr/bin/php7.1   71        manual mode

Press <enter> to keep the current choice[*], or type selection number: 2

# update-alternatives --config php
There are 3 choices for the alternative php (providing /usr/bin/php).

  Selection    Path             Priority   Status
------------------------------------------------------------
  0            /usr/bin/php7.1   71        auto mode
  1            /usr/bin/php5.6   56        manual mode
* 2            /usr/bin/php7.0   70        manual mode
  3            /usr/bin/php7.1   71        manual mode

Press <enter> to keep the current choice[*], or type selection number: 

次に、7.1パッケージを削除しました。

apt-get remove php7.1-cli
apt-get autoremove

その後、すべてのphp7.1パッケージが消えました。

それからこれを試しました。

apt-get update --fix-missing
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease                            
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [802 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [723 kB]
Fetched 1,850 kB in 1s (1,091 kB/s)                      
Reading package lists... Done

# apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

まだ運がないですね…わかりません。どんな提案がありますか?


修正する:

コメントで要求されたように:

# apt policy php-common
php-common:
  Installed: 1:62+ubuntu14.04.1+deb.sury.org+1
  Candidate: 1:62+ubuntu14.04.1+deb.sury.org+1
  Version table:
 *** 1:62+ubuntu14.04.1+deb.sury.org+1 100
        100 /var/lib/dpkg/status
     1:35ubuntu6.1 500
        500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages
     1:35ubuntu6 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu xenial/main i386 Packages

ベストアンサー1

PHP 7.1パッケージの残りの部分が1つ以上あります。php-commonUbuntuリポジトリで利用可能なバージョンにダウングレードする必要があります。

apt install php-common=1:35ubuntu6.1

おすすめ記事