数日前にシステムをアップグレードしましたが、その後、MySQLといくつかのライブラリに影響を与える破損したパッケージの問題がありました。その後、更新を行うことはできますが、パッケージをインストール、アップグレード、削除、またはパージすることはできません。また、依存関係の破損の問題を解決する方法が見つかりません。
壊れた依存関係とMySQLの問題が直接関連しているかどうかはわかりませんが、両方を別々に説明しようとします。
最初にパッケージをインストールまたはアップグレードしようとすると、次のメッセージが表示されます。
$ Sudo apt-get upgrade
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:
libsasl2-modules:i386 : Depends: libssl1.0.0:i386 (>= 1.0.0) but it is not installed
skype-bin:i386 : Depends: libssl1.0.0:i386 but it is not installed
E: Unmet dependencies. Try using -f.
Upgrade -fオプションを使用すると、次のようになります
$ Sudo apt-get -f upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
Calculating upgrade... Done
The following NEW packages will be installed:
libssl1.0.0:i386
The following packages will be upgraded:
snapd
1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/5,235 kB of archives.
After this operation, 6,545 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
Setting up mysql-common (5.7.12-0ubuntu1.1) ...
update-alternatives: error: alternative path /etc/mysql/my.cnf.fallback doesn't exist
dpkg: error processing package mysql-common (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
mysql-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
Synapticを見ると、次の壊れたパッケージが表示されます
libsasl2-modules;i386
skype-bin:i386
ここで、Synapticで常に同じエラーメッセージを取得、削除、再インストール、または削除しようとすると
E: mysql-common: subprocess installed post-installation script returned error exit status 2
MySQL(最新バージョンで理論的にインストールされているもの)を構成しようとすると、次のメッセージが表示されます。
$ Sudo dpkg --configure -a
Setting up mysql-common (5.7.12-0ubuntu1.1) ...
update-alternatives: error: alternative path /etc/mysql/my.cnf.fallback doesn't exist
dpkg: error processing package mysql-common (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of mysql-server-5.7:
mysql-server-5.7 depends on mysql-common (>= 5.6.22-1~); however:
Package mysql-common is not configured yet.
mysql-server-5.7 depends on mysql-common (>= 5.5); however:
Package mysql-common is not configured yet.
dpkg: error processing package mysql-server-5.7 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of mysql-server:
mysql-server depends on mysql-server-5.7; however:
Package mysql-server-5.7 is not configured yet.
dpkg: error processing package mysql-server (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
mysql-common
mysql-server-5.7
mysql-server
MySQLのアップグレードでは、何かが本当に奇妙でした。たとえば、ファイルmy.cnf
、my.cnf.fallback
などを探しています...ファイルとそのフォルダがもう存在しないことに気付きました。アップグレード中にそれらがどのように消えるかを無視します。
次のメッセージが表示されることを期待せずにMySQLを再インストールしようとしています。
$ Sudo apt-get -f install mysql-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-common is already the newest version (5.7.12-0ubuntu1.1).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libsasl2-modules:i386 : Depends: libssl1.0.0:i386 (>= 1.0.0) but it is not going to be installed
skype-bin:i386 : Depends: libssl1.0.0:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
パージを使用してそれらを削除し、ゼロから開始すると、同じ問題が発生します
$ Sudo apt-get purge mysql-common
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:
libmysqlclient18 : Depends: mysql-common (>= 5.5) but it is not going to be installed
libmysqlclient18:i386 : Depends: mysql-common:i386 (>= 5.5)
libmysqlclient20 : Depends: mysql-common (>= 5.5) but it is not going to be installed
libsasl2-modules:i386 : Depends: libssl1.0.0:i386 (>= 1.0.0) but it is not going to be installed
mysql-client-5.7 : Depends: mysql-common (>= 5.5) but it is not going to be installed
mysql-server-5.7 : PreDepends: mysql-common (>= 5.5) but it is not going to be installed
Depends: mysql-common (>= 5.6.22-1~) but it is not going to be installed
skype-bin:i386 : Depends: libssl1.0.0:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
apt-get -f install
を試すと、
$ Sudo apt-get -f install
[Sudo] password for user:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
libssl1.0.0:i386
The following NEW packages will be installed:
libssl1.0.0:i386
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
3 not fully installed or removed.
Need to get 0 B/949 kB of archives.
After this operation, 3,207 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
Setting up mysql-common (5.7.12-0ubuntu1.1) ...
update-alternatives: error: alternative path /etc/mysql/my.cnf.fallback doesn't exist
dpkg: error processing package mysql-common (--configure):
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
mysql-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
誰かがアイデアを持っている、私にできることは?
次のコマンドを実行します。
mkdir MYSQL
cd MYSQL
Sudo apt-get download mysql-common
ar xvf mysql*
tar xvf dat*
Sudo cp ./etc/mysql/my.cnf.fallback /etc/mysql/my.cnf.fallback
Sudo dpkg -i mysql*deb
cd
Sudo apt-get -f install