我在 Ubuntu 20.04 上安装了 MySQL 服务器 8,我需要将其删除,然后才能安装5.6.51。我执行了 apt-get remove mysql-server 等,但它卡在了 64%,我停止并重新启动。我尝试安装 5.6.51,但它也卡住了。我在 /var/lib/dpkg/ 中执行了 sudo rm lock-frontend。现在我尝试删除 5.6.51 并进行全新安装,但删除显示“正在设置 mysql-community-server (5.6.51-1debian9)”
我甚至这样做了sudo apt autoremove
- 它卡在了 93%:
Removing libgupnp-1.2-0:amd64 (1.2.3-0ubuntu0.20.04.1) ...
Removing libgssdp-1.2-0:amd64 (1.2.3-0ubuntu0.20.04.1) ...
Setting up mysql-community-server (5.6.51-1debian9) ...
。
~$ sudo apt-get remove mysql
[sudo] password for ubuntu:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'mysql' is not installed, so not removed
The following packages were automatically installed and are no longer required:
acl apg colord-data gnome-control-center-faces gnome-online-accounts gyp hplip-data javascript-common libc-ares2 libcgi-fast-perl libcgi-pm-perl libcolord-gtk1 libcolorhug2 libfcgi-perl
libfprint-2-tod1 libgsasl7 libgsound0 libgssdp-1.2-0 libgupnp-1.2-0 libgupnp-av-1.0-2 libgupnp-dlna-2.0-3 libhtml-template-perl libieee1284-3 libimagequant0 libjs-inherits libjs-is-typedarray
libjs-psl libjs-typedarray-to-buffer libkyotocabinet16v5 libllvm10 libmecab2 libnode-dev libnode64 libntlm0 librygel-core-2.6-2 librygel-db-2.6-2 librygel-renderer-2.6-2 librygel-server-2.6-2
libsane-common libsnmp-base libssl-dev libuv1-dev libwebpmux3 mailutils-common mecab-ipadic mecab-ipadic-utf8 mecab-utils mobile-broadband-provider-info network-manager-gnome nodejs-doc
printer-driver-postscript-hp python-pkg-resources python3-macaroonbakery python3-olefile python3-pil python3-protobuf python3-pymacaroons python3-renderpm python3-reportlab python3-reportlab-accel
python3-rfc3339 python3-tz rygel
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
4 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mysql-community-server (5.6.51-1debian9) ...
当我尝试删除时,为什么它会设置 mysql-community-server?
sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up cups (2.3.1-9ubuntu1.1) ...
Updating PPD files for cups ...
Setting up man-db (2.9.1-1) ...
Updating database of manual pages ...
man-db.service is a disabled or a static unit, not starting it.
Setting up mysql-community-server (5.6.51-1debian9) ...
Progress: [ 38%] [#####################################################################................................................................................................................]
答案1
我以某种方式解决了这个问题。
apt list --installed | grep -i mysql
sudo apt remove <package name>
sudo apt-get remove --purge mysql*
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get remove dbconfig-mysql
sudo apt --fix-broken install