尝试在 Kali Linux 操作系统上安装 MySQL,但在安装结束时出现“E: Sub-process /usr/bin/dpkg returned an error code (1)”错误。如果有人有想法,我想知道如何解决这个问题。
这里是安装概述:
(kaliuser㉿kali)-[~]
└─$ sudo apt-get install mysql-server mysql-common 1 ⚙
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-community-client mysql-community-client-core
mysql-community-client-plugins mysql-community-server mysql-community-server-core
The following NEW packages will be installed:
libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client mysql-common mysql-community-client mysql-community-client-core
mysql-community-client-plugins mysql-community-server mysql-community-server-core mysql-server
0 upgraded, 12 newly installed, 0 to remove and 1218 not upgraded.
Need to get 83.9 kB/31.2 MB of archives.
After this operation, 254 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 mysql-server amd64 8.0.23-1ubuntu18.04 [83.9 kB]
Fetched 83.9 kB in 2s (49.8 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 259395 files and directories currently installed.)
Preparing to unpack .../00-mysql-common_8.0.23-1ubuntu18.04_amd64.deb ...
Unpacking mysql-common (8.0.23-1ubuntu18.04) ...
Selecting previously unselected package mysql-community-client-plugins.
Preparing to unpack .../01-mysql-community-client-plugins_8.0.23-1ubuntu18.04_amd64.deb ...
.......
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix : 100% |###########################################|
done!
update-alternatives: using /var/lib/mecab/dic/ipadic-utf8 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Processing triggers for libc-bin (2.31-4) ...
Processing triggers for man-db (2.9.3-2) ...
Processing triggers for kali-menu (2020.4.0) ...
Errors were encountered while processing:
mysql-common
mysql-community-server
mysql-server
mysql-community-client
mysql-client
**E: Sub-process /usr/bin/dpkg returned an error code (1)**
答案1
在 Kali Linux 中,MYSQL 已被 MariaDB 取代。您已经为 Ubuntu 18.04 添加了 MYSQL apt 存储库,这就是apt
损坏的原因。
要解决损坏的问题apt
,请备份您的文件,/var/lib/dpkg/status
然后通过删除以下软件包及其描述来编辑它:mysql-common mysql-community-server mysql-server mysql-community-client mysql-client
然后安装 MariaDB:
sudo dpkg --configure -a
sudo apt update
sudo apt install mariadb-server mariadb-client