认识到这基本上是一个常见问题解答:
nicholas@mordor:~$
nicholas@mordor:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
nicholas@mordor:~$
nicholas@mordor:~$ sudo apt autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
nicholas@mordor:~$
nicholas@mordor:~$ sudo dpkg --get-selections | grep hold
nicholas@mordor:~$
nicholas@mordor:~$ sudo apt install mariadb-server mariadb-client
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 resolve the situation:
The following packages have unmet dependencies:
mariadb-server : Depends: mariadb-server-10.3 (>= 1:10.3.25-0ubuntu0.20.04.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
nicholas@mordor:~$
nicholas@mordor:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
nicholas@mordor:~$
nicholas@mordor:~$ sudo apt update
Hit:1 http://ca.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://ca.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://ca.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
nicholas@mordor:~$
nicholas@mordor:~$ sudo apt install mariadb-server mariadb-client
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 resolve the situation:
The following packages have unmet dependencies:
mariadb-server : Depends: mariadb-server-10.3 (>= 1:10.3.25-0ubuntu0.20.04.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
nicholas@mordor:~$
但是我如何找出持有或损坏的东西?
还:
nicholas@mordor:~$
nicholas@mordor:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
nicholas@mordor:~$
nicholas@mordor:~$ sudo dpkg --configure -a
nicholas@mordor:~$
来源:
nicholas@mordor:~$
nicholas@mordor:~$ cat /etc/apt/sources.list
# deb cdrom:[Ubuntu 20.04 LTS _Focal Fossa_ - Release amd64 (20200423)]/ focal main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://ca.archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://ca.archive.ubuntu.com/ubuntu/ focal main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://ca.archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://ca.archive.ubuntu.com/ubuntu/ focal-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://ca.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://ca.archive.ubuntu.com/ubuntu/ focal universe
deb http://ca.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://ca.archive.ubuntu.com/ubuntu/ focal-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://ca.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://ca.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://ca.archive.ubuntu.com/ubuntu/ focal-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://ca.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://ca.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner
deb http://security.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
# deb-src http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse
# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
nicholas@mordor:~$
政策:
nicholas@mordor:~$
nicholas@mordor:~$ apt policy
Package files:
100 /var/lib/dpkg/status
release a=now
500 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=multiverse,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/universe i386 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=universe,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=universe,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/restricted i386 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=restricted,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=restricted,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=main,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
release v=20.04,o=Ubuntu,a=focal-security,n=focal,l=Ubuntu,c=main,b=amd64
origin security.ubuntu.com
100 http://ca.archive.ubuntu.com/ubuntu focal-backports/universe i386 Packages
release v=20.04,o=Ubuntu,a=focal-backports,n=focal,l=Ubuntu,c=universe,b=i386
origin ca.archive.ubuntu.com
100 http://ca.archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal-backports,n=focal,l=Ubuntu,c=universe,b=amd64
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal-updates/multiverse i386 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=multiverse,b=i386
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=multiverse,b=amd64
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=universe,b=i386
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=universe,b=amd64
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal-updates/restricted i386 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=restricted,b=i386
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=restricted,b=amd64
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=main,b=i386
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
release v=20.04,o=Ubuntu,a=focal-updates,n=focal,l=Ubuntu,c=main,b=amd64
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal/multiverse i386 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=multiverse,b=i386
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=multiverse,b=amd64
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal/universe i386 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=i386
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=amd64
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal/restricted i386 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=restricted,b=i386
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal/restricted amd64 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=restricted,b=amd64
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal/main i386 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=main,b=i386
origin ca.archive.ubuntu.com
500 http://ca.archive.ubuntu.com/ubuntu focal/main amd64 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=main,b=amd64
origin ca.archive.ubuntu.com
Pinned packages:
nicholas@mordor:~$
我有一个类似的问题。Mysql-server 已安装,但两者不能同时安装。使用 user535733 评论找到它。然后可以卸载mysql和mariadb。
使用 mariadb.org 存储库本身将主要 mariadb 版本从 10.3 升级到 10.4 时发生在我身上。
可能我缺乏洞察力,但
apt depends -r <package>
没有给我提示,但我知道链是 mariadb-server -> mariadb-server-10.x -> mariadb-server-core-10.x。在首先删除所有 mariadb 包并提供所有包之后,apt 确实遵守了。
就我而言,我还不能进入 10.4.19,所以使用 apt-cache policy 的输出来使用特定版本。