web-dev-qa-db-ja.com

Debian 9 Stretchへのmysql-serverのインストールエラー(依存関係の問題)

Debian 9.5を使用して、新規インストールします。 mysql-serverをインストールしたいのですが、依存関係の問題が発生します。

Sudo apt-get install mysql-server
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:
 mysql-server : Depends: default-mysql-server but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

apt-get install mysql-server default-mysql-server
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:
 default-mysql-server : Depends: mariadb-server-10.1 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Sudo apt-get install mysql-server default-mysql-server mariadb-server-10.1
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:
 mariadb-server-10.1 : Depends: libdbi-Perl but it is not going to be installed
                       Recommends: libhtml-template-Perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Sudo apt-get install mysql-server default-mysql-server mariadb-server-10.1 libhtml-template-Perl
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:
 libhtml-template-Perl : Depends: libcgi-pm-Perl but it is not going to be installed or
                                  Perl (< 5.19) but 5.26.2-7 is to be installed
 mariadb-server-10.1 : Depends: libdbi-Perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Sudo apt-get install mysql-server default-mysql-server mariadb-server-10.1 libdbi-Perl
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:
 libdbi-Perl : Depends: perlapi-5.24.1
E: Unable to correct problems, you have held broken packages.

編集1:apt-cache policy

apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://security.debian.org/debian-security stretch/updates/contrib AMD64 Packages
     release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=contrib,b=AMD64
     Origin security.debian.org
 500 http://security.debian.org/debian-security stretch/updates/main AMD64 Packages
     release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=main,b=AMD64
     Origin security.debian.org
 500 http://deb.debian.org/debian stretch-updates/main AMD64 Packages
     release o=Debian,a=stable-updates,n=stretch-updates,l=Debian,c=main,b=AMD64
     Origin deb.debian.org
 500 http://deb.debian.org/debian stretch/main AMD64 Packages
     release v=9.5,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=AMD64
     Origin deb.debian.org
Pinned packages:

EDIT2:apt policy Perl perl-base

apt policy Perl perl-base
Perl:
  Installed: 5.26.2-7
  Candidate: 5.26.2-7
  Version table:
 *** 5.26.2-7 100
        100 /var/lib/dpkg/status
     5.24.1-3+deb9u4 500
        500 http://deb.debian.org/debian stretch/main AMD64 Packages
        500 http://security.debian.org/debian-security stretch/updates/main AMD64 Packages
Perl-base:
  Installed: 5.26.2-7
  Candidate: 5.26.2-7
  Version table:
 *** 5.26.2-7 100
        100 /var/lib/dpkg/status
     5.24.1-3+deb9u4 500
        500 http://deb.debian.org/debian stretch/main AMD64 Packages
        500 http://security.debian.org/debian-security stretch/updates/main AMD64 Packages

これらの依存関係の問題を修正するにはどうすればよいですか?

1
klor

あなたのapt policy Perl perl-base出力、および 指摘 by jordanm 、システムにはDebian9バージョンではなくBusterバージョンのPerlがあります。したがって、システムは実際にはDebian 9.5の「フレッシュインストール」ではありません。 PerlはDebianセットアップの非常に重要なコンポーネントであるため、Busterバージョンにアップグレードされた他の多くのパッケージが存在する可能性があります。

このPerlの不一致が、MySQLパッケージをインストールできない理由です。

これは最近のインストールであり、それにあまり投資していません。したがって、ヨルダンの 再インストールの推奨 は、おそらくこの場合の最良の解決策です。 Debian 9とBusterはかなり分岐しているため、特にPerlをアップグレードしたため、ロールバックはかなり複雑になる可能性があります。 mcを削除するだけでは確かに十分ではありません。

将来的には、安定版とテスト版を混在させないでください。パッケージを使用できないバグに遭遇した場合は、バグを報告してください(reportbug mc);十分に深刻な場合は、安定した更新の対象となる可能性があります。バックポートを要求することもできます。これにより、Debian 9用に再構築されたmcの現在のバスターバージョンが取得されます。

6
Stephen Kitt

受け入れられた解決策に基づいて、次のコマンドを正常に実行しました。

wget http://ftp.debian.org/debian/pool/main/p/Perl/perl-base_5.24.1-3+deb9u4_AMD64.deb
Sudo dpkg -i Perl-base*deb
    dpkg: warning: downgrading Perl-base from 5.26.2-7 to 5.24.1-3+deb9u4
    (Reading database ... 38749 files and directories currently installed.)
    Preparing to unpack Perl-base_5.24.1-3+deb9u4_AMD64.deb ...
    Unpacking Perl-base (5.24.1-3+deb9u4) over (5.26.2-7) ...
    Setting up Perl-base (5.24.1-3+deb9u4) ...
    Processing triggers for man-db (2.7.6.1-2) ...
Sudo apt-get install mysql-server
Sudo apt --fix-broken install
Sudo apt autoremove
Sudo apt-get install mysql-server
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    mysql-server is already the newest version (5.5.9999+default).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

結果:

dpkg -l Perl-base
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                  Version                         Architecture                    Description
+++-=====================================================-===============================-===============================-===============================================================================================================
ii  Perl-base                                             5.24.1-3+deb9u4                 AMD64                           minimal Perl system


dpkg -l mysql-server
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                  Version                         Architecture                    Description
+++-=====================================================-===============================-===============================-===============================================================================================================
ii  mysql-server                                          5.5.9999+default                AMD64                           MySQL database server binaries and system database setup [transitional]
2
klor