NextCloud - MySQL 损坏包错误

NextCloud - MySQL 损坏包错误

我对 Linux/Terminal 世界还很陌生,但我真的爱上了这款操作系统的所有简洁工具和大门。我正在尝试在 Ubuntu Server 20.04.3 上设置 NextCloud,然后本指南。我个人尽量避免使用 snap,因为我过去遇到过问题。我能够毫无问题地安装 Apache2,但是当我尝试安装 mysql-server 时,我得到以下信息:

$ sudo apt install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mysql-server : Depends: mysql-server-8.0 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
$

我已验证我的系统和软件包都是最新的:

$ sudo apt update
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Hit:4 http://us.archive.ubuntu.com/ubuntu focal-security InRelease
Hit:5 https://repo.jellyfin.org/ubuntu focal InRelease
Fetched 108 kB in 1s (103 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
$

我对这个问题的研究使我这个问题,其中一个答案提到使用 Synaptic 修复损坏的软件包。有没有终端等效程序?我没有在服务器上安装 GUI,以尽可能降低开销。我甚至不确定我是否走对了路。我能想到的唯一其他信息是做过无论如何,尝试通过 snap 安装,虽然它说安装成功,但是当我尝试进入 NextCloud 设置页面(通过浏览服务器的 IP 地址完成)时,我得到的只是 Apache“It Works”测试页面。

的输出sudo apt install mysql-server-8.0为:

$ sudo apt install mysql-server-8.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data apache2-utils galera-3 libconfig-inifiles-perl libdbi-perl libsnappy1v5 libterm-readkey-perl socat ssl-cert
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libevent-core-2.1-7 libevent-pthreads-2.1-7 libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-core-8.0
Suggested packages:
  mailx tinyca
The following NEW packages will be installed:
  libevent-core-2.1-7 libevent-pthreads-2.1-7 libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-8.0
  mysql-server-core-8.0
0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded.
Need to get 30.8 MB of archives.
After this operation, 260 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu focal/main amd64 mysql-common all 5.8+1.0.5ubuntu2 [7496 B]
Get:2 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 mysql-client-core-8.0 amd64 8.0.28-0ubuntu0.20.04.3 [4429 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 mysql-client-8.0 amd64 8.0.28-0ubuntu0.20.04.3 [22.0 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libevent-core-2.1-7 amd64 2.1.11-stable-1 [89.1 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libevent-pthreads-2.1-7 amd64 2.1.11-stable-1 [7372 B]
Get:6 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libmecab2 amd64 0.996-10build1 [233 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 mysql-server-core-8.0 amd64 8.0.28-0ubuntu0.20.04.3 [18.0 MB]
Get:8 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 mysql-server-8.0 amd64 8.0.28-0ubuntu0.20.04.3 [1271 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu focal/main amd64 mecab-utils amd64 0.996-10build1 [4912 B]
Get:10 http://us.archive.ubuntu.com/ubuntu focal/main amd64 mecab-ipadic all 2.7.0-20070801+main-2.1 [6714 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu focal/main amd64 mecab-ipadic-utf8 all 2.7.0-20070801+main-2.1 [4380 B]
Fetched 30.8 MB in 1s (23.9 MB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 157715 files and directories currently installed.)
Preparing to unpack .../0-mysql-common_5.8+1.0.5ubuntu2_all.deb ...
Unpacking mysql-common (5.8+1.0.5ubuntu2) ...
Selecting previously unselected package mysql-client-core-8.0.
Preparing to unpack .../1-mysql-client-core-8.0_8.0.28-0ubuntu0.20.04.3_amd64.deb ...
Unpacking mysql-client-core-8.0 (8.0.28-0ubuntu0.20.04.3) ...
Selecting previously unselected package mysql-client-8.0.
Preparing to unpack .../2-mysql-client-8.0_8.0.28-0ubuntu0.20.04.3_amd64.deb ...
Unpacking mysql-client-8.0 (8.0.28-0ubuntu0.20.04.3) ...
Selecting previously unselected package libevent-core-2.1-7:amd64.
Preparing to unpack .../3-libevent-core-2.1-7_2.1.11-stable-1_amd64.deb ...
Unpacking libevent-core-2.1-7:amd64 (2.1.11-stable-1) ...
Selecting previously unselected package libevent-pthreads-2.1-7:amd64.
Preparing to unpack .../4-libevent-pthreads-2.1-7_2.1.11-stable-1_amd64.deb ...
Unpacking libevent-pthreads-2.1-7:amd64 (2.1.11-stable-1) ...
Selecting previously unselected package libmecab2:amd64.
Preparing to unpack .../5-libmecab2_0.996-10build1_amd64.deb ...
Unpacking libmecab2:amd64 (0.996-10build1) ...
Selecting previously unselected package mysql-server-core-8.0.
Preparing to unpack .../6-mysql-server-core-8.0_8.0.28-0ubuntu0.20.04.3_amd64.deb ...
Unpacking mysql-server-core-8.0 (8.0.28-0ubuntu0.20.04.3) ...
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 ... 157932 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.28-0ubuntu0.20.04.3_amd64.deb ...
Downgrade from (at least) 10.3 to 5.7 is not possible.
MySQL has been frozen to prevent damage to your system. Please see /etc/mysql/FROZEN for help.
Unpacking mysql-server-8.0 (8.0.28-0ubuntu0.20.04.3) ...
Selecting previously unselected package mecab-utils.
Preparing to unpack .../mecab-utils_0.996-10build1_amd64.deb ...
Unpacking mecab-utils (0.996-10build1) ...
Selecting previously unselected package mecab-ipadic.
Preparing to unpack .../mecab-ipadic_2.7.0-20070801+main-2.1_all.deb ...
Unpacking mecab-ipadic (2.7.0-20070801+main-2.1) ...
Selecting previously unselected package mecab-ipadic-utf8.
Preparing to unpack .../mecab-ipadic-utf8_2.7.0-20070801+main-2.1_all.deb ...
Unpacking mecab-ipadic-utf8 (2.7.0-20070801+main-2.1) ...
Setting up libmecab2:amd64 (0.996-10build1) ...
Setting up mysql-client-core-8.0 (8.0.28-0ubuntu0.20.04.3) ...
Setting up mecab-utils (0.996-10build1) ...
Setting up libevent-core-2.1-7:amd64 (2.1.11-stable-1) ...
Setting up mysql-client-8.0 (8.0.28-0ubuntu0.20.04.3) ...
Setting up libevent-pthreads-2.1-7:amd64 (2.1.11-stable-1) ...
Setting up mecab-ipadic (2.7.0-20070801+main-2.1) ...
Compiling IPA dictionary for Mecab.  This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################|
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
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 to provide /var/lib/mecab/dic/debian (mecab-dictionary) in auto mode
Setting up mysql-server-core-8.0 (8.0.28-0ubuntu0.20.04.3) ...
Setting up mecab-ipadic-utf8 (2.7.0-20070801+main-2.1) ...
Compiling IPA dictionary for Mecab.  This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################|
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
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
Setting up mysql-server-8.0 (8.0.28-0ubuntu0.20.04.3) ...
Installing new version of config file /etc/apparmor.d/usr.sbin.mysqld ...
Installing new version of config file /etc/init.d/mysql ...
Installing new version of config file /etc/logrotate.d/mysql-server ...
Installing new version of config file /etc/mysql/debian-start ...
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
MySQL has been frozen to prevent damage to your system. Please see /etc/mysql/FROZEN for help.
Processing triggers for systemd (245.4-4ubuntu3.15) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
$

输出为sudo apt update && sudo apt install aptitude && sudo aptitude -f install mysql-server-8.0


$ sudo apt update && sudo apt install aptitude && sudo aptitude -f install mysql-server-8.0
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:3 https://repo.jellyfin.org/ubuntu focal InRelease
Get:4 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Fetched 336 kB in 1s (294 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data apache2-utils galera-3 libconfig-inifiles-perl libdbi-perl libsnappy1v5 libterm-readkey-perl socat ssl-cert
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  aptitude-common libclass-accessor-perl libcwidget4 libio-string-perl libparse-debianchangelog-perl libsigc++-2.0-0v5 libsub-name-perl libxapian30
Suggested packages:
  aptitude-doc-en | aptitude-doc apt-xapian-index debtags tasksel libcwidget-dev libxml-simple-perl xapian-tools
The following NEW packages will be installed:
  aptitude aptitude-common libclass-accessor-perl libcwidget4 libio-string-perl libparse-debianchangelog-perl libsigc++-2.0-0v5 libsub-name-perl libxapian30
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 4107 kB of archives.
After this operation, 19.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 aptitude-common all 0.8.12-1ubuntu4 [1711 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libsigc++-2.0-0v5 amd64 2.10.2-1build1 [11.7 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libcwidget4 amd64 0.5.18-5build1 [306 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libxapian30 amd64 1.4.14-2 [661 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 aptitude amd64 0.8.12-1ubuntu4 [1323 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libsub-name-perl amd64 0.26-1 [11.5 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libclass-accessor-perl all 0.51-1 [21.2 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu focal/main amd64 libio-string-perl all 1.08-3 [11.1 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 libparse-debianchangelog-perl all 1.2.0-13 [49.7 kB]
Fetched 4107 kB in 1s (5905 kB/s)
Selecting previously unselected package aptitude-common.
(Reading database ... 158020 files and directories currently installed.)
Preparing to unpack .../0-aptitude-common_0.8.12-1ubuntu4_all.deb ...
Unpacking aptitude-common (0.8.12-1ubuntu4) ...
Selecting previously unselected package libsigc++-2.0-0v5:amd64.
Preparing to unpack .../1-libsigc++-2.0-0v5_2.10.2-1build1_amd64.deb ...
Unpacking libsigc++-2.0-0v5:amd64 (2.10.2-1build1) ...
Selecting previously unselected package libcwidget4:amd64.
Preparing to unpack .../2-libcwidget4_0.5.18-5build1_amd64.deb ...
Unpacking libcwidget4:amd64 (0.5.18-5build1) ...
Selecting previously unselected package libxapian30:amd64.
Preparing to unpack .../3-libxapian30_1.4.14-2_amd64.deb ...
Unpacking libxapian30:amd64 (1.4.14-2) ...
Selecting previously unselected package aptitude.
Preparing to unpack .../4-aptitude_0.8.12-1ubuntu4_amd64.deb ...
Unpacking aptitude (0.8.12-1ubuntu4) ...
Selecting previously unselected package libsub-name-perl.
Preparing to unpack .../5-libsub-name-perl_0.26-1_amd64.deb ...
Unpacking libsub-name-perl (0.26-1) ...
Selecting previously unselected package libclass-accessor-perl.
Preparing to unpack .../6-libclass-accessor-perl_0.51-1_all.deb ...
Unpacking libclass-accessor-perl (0.51-1) ...
Selecting previously unselected package libio-string-perl.
Preparing to unpack .../7-libio-string-perl_1.08-3_all.deb ...
Unpacking libio-string-perl (1.08-3) ...
Selecting previously unselected package libparse-debianchangelog-perl.
Preparing to unpack .../8-libparse-debianchangelog-perl_1.2.0-13_all.deb ...
Unpacking libparse-debianchangelog-perl (1.2.0-13) ...
Setting up libxapian30:amd64 (1.4.14-2) ...
Setting up libio-string-perl (1.08-3) ...
Setting up libsigc++-2.0-0v5:amd64 (2.10.2-1build1) ...
Setting up aptitude-common (0.8.12-1ubuntu4) ...
Setting up libsub-name-perl (0.26-1) ...
Setting up libclass-accessor-perl (0.51-1) ...
Setting up libcwidget4:amd64 (0.5.18-5build1) ...
Setting up libparse-debianchangelog-perl (1.2.0-13) ...
Setting up aptitude (0.8.12-1ubuntu4) ...
update-alternatives: using /usr/bin/aptitude-curses to provide /usr/bin/aptitude (aptitude) in auto mode
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
mysql-server-8.0 is already installed at the requested version (8.0.28-0ubuntu0.20.04.3)
mysql-server-8.0 is already installed at the requested version (8.0.28-0ubuntu0.20.04.3)
The following packages will be REMOVED:
  apache2-data{u} apache2-utils{u} galera-3{u} libconfig-inifiles-perl{u} libdbi-perl{u} libsnappy1v5{u} libterm-readkey-perl{u} socat{u} ssl-cert{u}
0 packages upgraded, 0 newly installed, 9 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 7837 kB will be freed.
Do you want to continue? [Y/n/?] y
(Reading database ... 158301 files and directories currently installed.)
Removing apache2-data (2.4.41-4ubuntu3.9) ...
Removing apache2-utils (2.4.41-4ubuntu3.9) ...
Removing galera-3 (25.3.29-1) ...
Removing libconfig-inifiles-perl (3.000002-1) ...
Removing libdbi-perl:amd64 (1.643-1ubuntu0.1) ...
Removing libsnappy1v5:amd64 (1.1.8-1build1) ...
Removing libterm-readkey-perl (2.38-1build1) ...
Removing socat (1.7.3.3-2) ...
Removing ssl-cert (1.0.39) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
$

任何帮助都将不胜感激!

相关内容