Ubuntu20.04安裝MySQL8.0時出現依賴錯誤解決辦法
博文背景
在使用apt安裝mysql8.0時出現瞭如下的依賴報錯:
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
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)
問題解決
作者先進行了換源,然後重新安裝,發現還是同樣的報錯,那麼說明不是源的問題,作者再檢視一下埠是否被佔用,發現3306埠被我的docker中的一個mysql容器給暴露出來了所以導致埠被佔用。
於是我關閉了docker,再次重新使用apt安裝MySQL8.0問題立馬得到解決。
日誌記錄
root@yellow:~# apt install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mysql-server is already the newest version (8.0.21-0ubuntu0.20.04.4).
0 upgraded, 0 newly installed, 0 to remove and 114 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.21-0ubuntu0.20.04.4) ...
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 402583
dpkg: error processing package mysql-server-8.0 (--configure):
installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
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)
root@yellow:~# apt purge mysql-
mysql-client-8.0 mysql-common mysql-server-core-8.0
mysql-client-core-8.0 mysql-server
root@yellow:~# apt purge mysql-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libcgi-fast-perl libcgi-pm-perl libencode-locale-perl libevent-core-2.1-7 libfcgi-perl
libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhttp-date-perl
libhttp-message-perl libio-html-perl liblwp-mediatypes-perl libmecab2 libtimedate-perl
liburi-perl mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client-core-8.0
mysql-server-core-8.0
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
mysql-client-8.0* mysql-common* mysql-server* mysql-server-8.0*
0 upgraded, 0 newly installed, 4 to remove and 114 not upgraded.
2 not fully installed or removed.
After this operation, 1,767 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 113032 files and directories currently installed.)
Removing mysql-server (8.0.21-0ubuntu0.20.04.4) ...
Removing mysql-server-8.0 (8.0.21-0ubuntu0.20.04.4) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Removing mysql-client-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Removing mysql-common (5.8+1.0.5ubuntu2) ...
Processing triggers for man-db (2.9.1-1) ...
(Reading database ... 112983 files and directories currently installed.)
Purging configuration files for mysql-server-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Purging configuration files for mysql-common (5.8+1.0.5ubuntu2) ...
dpkg: warning: while removing mysql-common, directory '/etc/mysql' not empty so not removed
Processing triggers for systemd (245.4-4ubuntu3) ...
root@yellow:~# ss -ntlp
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 4096 127.0.0.1:45959 0.0.0.0:* users:(("containerd",pid=2252,fd=6))
LISTEN 0 32 10.236.187.1:53 0.0.0.0:* users:(("dnsmasq",pid=18295,fd=9))
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=491,fd=13))
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=672,fd=3))
LISTEN 0 128 127.0.0.1:6010 0.0.0.0:* users:(("sshd",pid=285982,fd=10))
LISTEN 0 128 127.0.0.1:6011 0.0.0.0:* users:(("sshd",pid=395705,fd=10))
LISTEN 0 4096 *:3306 *:* users:(("docker-proxy",pid=15624,fd=4))
LISTEN 0 32 [fd42:2fe:1e1:9cb7::1]:53 [::]:* users:(("dnsmasq",pid=18295,fd=11))
LISTEN 0 128 [::1]:6010 [::]:* users:(("sshd",pid=285982,fd=9))
LISTEN 0 128 [::1]:6011 [::]:* users:(("sshd",pid=395705,fd=9))
root@yellow:~# systemctl stop docker
root@yellow:~# apt install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
mysql-client-8.0 mysql-common mysql-server-8.0
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-client-8.0 mysql-common mysql-server mysql-server-8.0
0 upgraded, 4 newly installed, 0 to remove and 114 not upgraded.
Need to get 0 B/1,288 kB of archives.
After this operation, 1,767 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 112964 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.8+1.0.5ubuntu2_all.deb ...
Unpacking mysql-common (5.8+1.0.5ubuntu2) ...
Selecting previously unselected package mysql-client-8.0.
Preparing to unpack .../mysql-client-8.0_8.0.21-0ubuntu0.20.04.4_amd64.deb ...
Unpacking mysql-client-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Setting up mysql-common (5.8+1.0.5ubuntu2) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-8.0.
(Reading database ... 112993 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.21-0ubuntu0.20.04.4_amd64.deb ...
Unpacking mysql-server-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_8.0.21-0ubuntu0.20.04.4_all.deb ...
Unpacking mysql-server (8.0.21-0ubuntu0.20.04.4) ...
Setting up mysql-client-8.0 (8.0.21-0ubuntu0.20.04.4) ...
Setting up mysql-server-8.0 (8.0.21-0ubuntu0.20.04.4) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 404343
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
Setting up mysql-server (8.0.21-0ubuntu0.20.04.4) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3) ...
root@yellow:~# systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2020-09-25 19:22:56 CST; 4min 33s ago
Main PID: 404680 (mysqld)
Status: "Server is operational"
Tasks: 38 (limit: 4657)
Memory: 331.8M
CGroup: /system.slice/mysql.service
└─404680 /usr/sbin/mysqld
Sep 25 19:22:55 yellow systemd[1]: Starting MySQL Community Server...
Sep 25 19:22:56 yellow systemd[1]: Started MySQL Community Server.
root@yellow:~# ss -ntlp
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 4096 127.0.0.1:45959 0.0.0.0:* users:(("containerd",pid=2252,fd=6))
LISTEN 0 151 127.0.0.1:3306 0.0.0.0:* users:(("mysqld",pid=404680,fd=33))
LISTEN 0 32 10.236.187.1:53 0.0.0.0:* users:(("dnsmasq",pid=18295,fd=9))
LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:* users:(("systemd-resolve",pid=491,fd=13))
LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:(("sshd",pid=672,fd=3))
LISTEN 0 128 127.0.0.1:6010 0.0.0.0:* users:(("sshd",pid=285982,fd=10))
LISTEN 0 128 127.0.0.1:6011 0.0.0.0:* users:(("sshd",pid=395705,fd=10))
LISTEN 0 70 *:33060 *:* users:(("mysqld",pid=404680,fd=31))
LISTEN 0 32 [fd42:2fe:1e1:9cb7::1]:53 [::]:* users:(("dnsmasq",pid=18295,fd=11))
LISTEN 0 128 [::1]:6010 [::]:* users:(("sshd",pid=285982,fd=9))
LISTEN 0 128 [::1]:6011 [::]:* users:(("sshd",pid=395705,fd=9))
相關文章
- ubuntu解決軟體安裝依賴錯誤Ubuntu
- Mysql出現連線錯誤解決辦法MySql
- 安裝wsl錯誤的一種解決辦法
- PHP編譯安裝時常見錯誤解決辦法,php編譯常見錯誤PHP編譯
- Ubuntu 安裝包時提示錯誤E: Unable to locate package mysql-server錯誤 解決辦法UbuntuPackageMySqlServer
- python3.9安裝wordcloud出錯解決辦法PythonCloud
- git add .出現錯誤LF will be replaced by CRLF in 解決辦法Git
- 【git】Git commit時提示錯誤時 解決辦法GitMIT
- 出現可怕的NoSuchMethodError錯誤的解決辦法 -Gunnar MorlingError
- Adobe 2022軟體安裝錯誤程式碼107解決辦法
- yum安裝軟體時,出現"No package XXX available"的解決辦法PackageAI
- 【python】pip安裝庫時出現Read timed out.解決辦法Python
- Python: 安裝 sklearn 包出現錯誤的解決方法Python
- Ubuntu20.04安裝LabelImg 以及出現(ModuleNotFoundError: No module named libs.resources)錯誤UbuntuError
- 安裝CentOS7出現dracut:/#……time解決辦法CentOS
- RoboWare Studio安裝及依賴項解決
- Win7 IIS7.5執行ASP時出現500錯誤的解決辦法Win7
- 在使用Apple M1晶片重新安裝macOS出現錯誤的解決辦法APP晶片Mac
- Ubuntu20.04出現段錯誤核心已轉儲問題解決方案Ubuntu
- steam磁碟寫入錯誤怎麼解決 steam安裝時發生錯誤怎麼辦
- CATIA許可證時間錯誤的解決辦法
- 安裝vCenter Server出現1603錯誤的一種解決方法Server
- npm 或 yarn安裝依賴報錯 EPERM: operation not permitted, unlink 解決方法NPMYarnMIT
- 畢設之錯誤解決辦法
- Idea編譯錯誤解決辦法Idea編譯
- npm 使用安裝超時的解決辦法NPM
- QT6安裝Android SDK出現"Android SDK Command-line Tools run"出錯解決辦法QTAndroid
- vscode使用npm安裝依賴報錯VSCodeNPM
- 解決安裝ubuntu系統時出現錯誤:(10, “debian-installer/locale doesn‘t exist“)Ubuntu
- 伺服器出現500錯誤的原因和解決辦法伺服器
- 安裝完fiddler每次啟動出現這錯誤,我的解決!
- 【STM32】使用Keil5載入程式時出現No Target Connected錯誤的解決辦法
- ubuntu下import matplotlib錯誤解決辦法UbuntuImport
- sbt下載相關依賴過慢的解決辦法
- 關於npm install安裝報錯的解決辦法NPM
- wget下載安裝時出現錯誤doesn‘t match requested host name錯誤wget
- 解決安裝LR後提示內部出現錯誤,無法建立資料夾的問題
- win10安裝程式installer錯誤怎麼辦_win10安裝程式installer錯誤解決方法Win10