我的系统有一个损坏的 MariaDb 更新,从 10.3 到 10.4。 MariaDb 仍然工作正常,但现在我遇到了系统升级问题。我尝试在网上寻找解决方案,但似乎找不到任何东西。问题:
$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
mariadb-server-10.3 : Depends: mariadb-client-10.3 (>= 1:10.3.28+maria~buster) but 1:10.3.27-0+deb10u1 is installed
mariadb-server-core-10.3 : Breaks: mariadb-client-10.3 (< 1:10.3.28+maria~buster) but 1:10.3.27-0+deb10u1 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
当我尝试修复损坏时:
$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libconfig-inifiles-perl libsnappy1v5
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
mariadb-client-10.3 mariadb-client-core-10.3
The following packages will be upgraded:
mariadb-client-10.3 mariadb-client-core-10.3
2 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
6 not fully installed or removed.
Need to get 0 B/1,868 kB of archives.
After this operation, 19.6 MB disk space will be freed.
Do you want to continue? [Y/n] Y
Reading changelogs... Done
dpkg: regarding .../mariadb-client-core-10.3_1%3a10.3.28+maria~buster_amd64.deb containing mariadb-client-core-10.3:
mariadb-client-10.3 conflicts with mysql-client-core-5.5
mariadb-client-core-10.3 provides mysql-client-core-5.5 and is to be installed.
dpkg: error processing archive /var/cache/apt/archives/mariadb-client-core-10.3_1%3a10.3.28+maria~buster_amd64.deb (--unpack):
conflicting packages - not installing mariadb-client-core-10.3
dpkg: regarding .../mariadb-client-10.3_1%3a10.3.28+maria~buster_amd64.deb containing mariadb-client-10.3:
mariadb-client-core-10.3 conflicts with mysql-client-5.5
mariadb-client-10.3 provides mysql-client-5.5 and is to be installed.
dpkg: error processing archive /var/cache/apt/archives/mariadb-client-10.3_1%3a10.3.28+maria~buster_amd64.deb (--unpack):
conflicting packages - not installing mariadb-client-10.3
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-client-core-10.3_1%3a10.3.28+maria~buster_amd64.deb
/var/cache/apt/archives/mariadb-client-10.3_1%3a10.3.28+maria~buster_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
是否安装了多个软件包?有任何想法吗?
编辑:添加更多信息
请编辑您的帖子以显示 /etc/apt/sources.list 的内容:
deb http://deb.debian.org/debian/ buster main
deb-src http://deb.debian.org/debian/ buster main
deb http://security.debian.org/debian-security buster/updates main contrib
deb-src http://security.debian.org/debian-security buster/updates main contrib
# buster-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ buster-updates main contrib
deb [arch=arm64,ppc64el,amd64] http://mariadb.mirror.globo.tech/repo/10.3/debian buster main
# deb-src [arch=arm64,ppc64el,amd64] http://mariadb.mirror.globo.tech/repo/10.3/debian buster main
deb [arch=arm64,ppc64el,amd64] http://mariadb.mirror.globo.tech/repo/10.4/debian buster main
# deb-src [arch=arm64,ppc64el,amd64] http://mariadb.mirror.globo.tech/repo/10.4/debian buster main
deb-src http://deb.debian.org/debian/ buster-updates main contrib
以及 /etc/apt/sources.list.d 中的任何 *.list 文件: ondrej-ubuntu-php-impish.list php7.list
答案1
我之前在卡利也遇到过这个问题。如果/etc/apt/sources.list.d
不为空,则“删除”目录中的所有内容。最好重命名这些文件而不是删除。您应该尝试执行以下命令。
sudo apt clean
sudo apt-get autoclean
sudo apt-get update
sudo apt-get upgrade
如果你继续面对这个问题,那就尝试一下
sudo apt --fix-broken install
sudo apt-get upgrade
如果您再次遇到问题,请以 root 用户身份运行( sudo su
)
sudo -s
apt --fix-broken install
apt upgrade