助けてください!子プロセス/usr/bin/dpkgはエラーコードを返します。 (1) UbuntuへのMySQLのインストール

助けてください!子プロセス/usr/bin/dpkgはエラーコードを返します。 (1) UbuntuへのMySQLのインストール

UbuntuにMySQLをインストールしようとしていますが、MySQLを消去して再ダウンロードするのに3日かかりましたが、成功しませんでした。私が見つけたほとんどのソリューションは私には適していませんでした。また、手動でファイルに入り、すべてのMySQL関連ファイルを手動で削除してみました。また、いくつかのdpkgファイルを再インストールしてみましたが、ご存知のように、私はこれにかなり慣れています。この問題をどのように解決できますか?

alvin@DESKTOP-DAIIHEJ:~$ sudo apt-get install mysql-server
[sudo] password for alvin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (8.0.27-0ubuntu0.20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up mysql-server-8.0 (8.0.27-0ubuntu0.20.04.1) ...
invoke-rc.d: could not determine current runlevel
 * Stopping MySQL database server mysqld                                                              [ OK ]
Renaming removed key_buffer and myisam-recover options (if present)
Cannot open /proc/net/unix: No such file or directory
Cannot stat file /proc/1/fd/5: Operation not permitted
Cannot stat file /proc/1/fd/10: Operation not permitted
Cannot stat file /proc/1/fd/6: Operation not permitted
Cannot stat file /proc/10/fd/7: Operation not permitted
Cannot stat file /proc/10/fd/10: Operation not permitted
Cannot stat file /proc/10/fd/5: Operation not permitted
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 143
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-8.0
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

これは私のエラーログです。

2022-01-27T22:38:25.061002Z 0 [System] [MY-013172] [Server] Received SHUTDOWN from user <via user signal>. Shutting down mysqld (Version: 8.0.27-0ubuntu0.20.04.1).
2022-01-27T22:38:25.981554Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.27-0ubuntu0.20.04.1)  (Ubuntu).
2022-01-27T22:38:26.615434Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.27-0ubuntu0.20.04.1) starting as process 206
2022-01-27T22:38:26.629831Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-01-27T22:38:26.648358Z 1 [ERROR] [MY-012585] [InnoDB] Linux Native AIO interface is not supported on this platform. Please check your OS documentation and install appropriate binary of InnoDB.
2022-01-27T22:38:26.648440Z 1 [Warning] [MY-012654] [InnoDB] Linux Native AIO disabled.
2022-01-27T22:38:26.787334Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-01-27T22:38:26.848746Z 0 [ERROR] [MY-011300] [Server] Plugin mysqlx reported: 'Setup of socket: '/var/run/mysqld/mysqlx.sock' failed, can't create lock file /var/run/mysqld/mysqlx.sock.lock'
2022-01-27T22:38:26.946919Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
2022-01-27T22:38:26.946963Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
2022-01-27T22:38:26.948630Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2022-01-27T22:38:26.948712Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2022-01-27T22:38:26.949587Z 0 [ERROR] [MY-010262] [Server] Can't start server: Bind on TCP/IP port: Permission denied
2022-01-27T22:38:26.949630Z 0 [ERROR] [MY-010257] [Server] Do you already have another mysqld server running on port: 3306 ?
2022-01-27T22:38:26.949908Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-01-27T22:38:27.949853Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.0.27-0ubuntu0.20.04.1)  (Ubuntu).

これが結果ですmount | grep proc

proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime) –

ベストアンサー1

上記の問題に対するいくつかの解決策があります

1. dpkgパッケージの再構成

このエラーの原因の1つは、破損したdpkgデータベースです。この問題は次のように解決できます。sudo dpkg --configure -a

2. 問題のあるパッケージの強制インストール

時々、パッケージのインストール中にエラーが発生することがあります。このような場合は、次のように-fオプションを使用してパッケージを強制的にインストールできます。

sudo apt install -f
OR
sudo apt install --fix-broken

3. 不良または破損したパッケージの取り外し

sudo apt remove --purge package_name

4. パッケージに関連するすべてのファイルを削除します。

最後に、問題のあるパッケージに関連するすべてのアイテムを手動で削除できます。まず、/var/lib/dpkg/info ディレクトリにあるこれらのファイルを探す必要があります。

sudo ls -l /var/lib/dpkg/info | grep -i package_name

ファイルが一覧表示されたら、そのファイルを/ tmpディレクトリに移動できます。

sudo mv /var/lib/dpkg/info/package-name.* /tmp

最後にパッケージリストを更新します。

sudo apt update

その後、パッケージを再インストールしてみてください。

発生するエラーは、ポート3306がすでに使用されているため、MySQLをインストールできないことです。

これにより、netstat -lp | grep 3306どのプログラムがすでにポート3306でリッスンしているかを確認し(最後の列にPID /プログラム名を表示する必要があります)、そのプログラムを停止できます(mysqlはすでに実行されていますか?)。

別のポートで新しくインストールされたサーバーを起動することもできます。 (my.cnfデフォルトポートを編集して変更してください)

おすすめ記事