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
- 關於IIS安裝後出現500錯誤的解決辦法
- scp出現錯誤的解決辦法
- Xamarin提示安裝包錯誤解決辦法
- 安裝Office2007時出現1402錯誤的解決辦法
- 安裝wsl錯誤的一種解決辦法
- PHP編譯安裝時常見錯誤解決辦法,php編譯常見錯誤PHP編譯
- Ubuntu 安裝包時提示錯誤E: Unable to locate package mysql-server錯誤 解決辦法UbuntuPackageMySqlServer
- Win7安裝錯誤提示與解決辦法Win7
- 在紅旗DC server 6.0上安裝oracle 11gR2時出現的錯誤,以及解決辦法ServerOracle
- Linux下安裝oracle,遇到錯誤的解決辦法LinuxOracle
- python3.9安裝wordcloud出錯解決辦法PythonCloud
- 安裝ionic 報錯 安裝canvas報錯 解決辦法Canvas
- git add .出現錯誤LF will be replaced by CRLF in 解決辦法Git
- 【git】Git commit時提示錯誤時 解決辦法GitMIT
- Fedora 8下永中Office安裝出錯的解決辦法
- 安裝CentOS7出現dracut:/#……time解決辦法CentOS
- NPM run dev 出現這樣錯誤我的解決辦法NPMdev
- springMVC資料驗證出現404錯誤解決辦法SpringMVC
- oracle 12c r2 rac 安裝時CLSRSC-400錯誤解決辦法Oracle
- Windows 8.1應用安裝錯誤0×80004005的解決辦法Windows
- 11g rac 安裝過程中常見錯誤解決辦法
- livemesh 安裝錯誤號:80070422 解決辦法
- SAP錯誤提示解決辦法
- vue安裝babel依賴報錯VueBabel
- dns錯誤怎麼辦 dns錯誤的解決辦法DNS
- Win7 IIS7.5執行ASP時出現500錯誤的解決辦法Win7
- 安裝sysbench過程報錯,解決辦法
- Python: 安裝 sklearn 包出現錯誤的解決方法Python
- ubuntu安裝軟體出現Unable to locate package錯誤解決UbuntuPackage
- man出錯解決辦法
- 安裝VMware出現“Error 1406”的解決辦法Error
- mysql安裝出現 conflicts with mysql*的解決辦法MySql
- RoboWare Studio安裝及依賴項解決
- steam磁碟寫入錯誤怎麼解決 steam安裝時發生錯誤怎麼辦
- Ubuntu20.04出現段錯誤核心已轉儲問題解決方案Ubuntu
- unity player 顯示播放錯誤時的解決辦法Unity
- npm 使用安裝超時的解決辦法NPM