我正在尝试升级我的系统,但是当我执行命令时发生了以下情况:
plex@plex-server:~$ sudo apt-get upgrade
[sudo] password for plex:
Reading package lists...
Building dependency tree
Reading state information... Done
You may want to run 'apt --fix-broken install' to fix it.
The following packages have unmet dependencies:
libgail-3-0 : Depends: libgtk-3-0 (=3.22.30-1ubuntu4) but 3.22.30-1ubuntu1 is installed
libgtk-3-bin : Depends: libgtk-3-0 (>= 3.22.30-1ubuntu4) but 3.22.30-1ubuntu1 is installed
E: Unmet dependencies. Run 'apt --fix-broken install' without packages (or specify a solution).
我之前已经完成更新并尝试了自动清理、自动删除、--fix-missing,但仍然不起作用。
编辑这是我的 sources.list 文件中的内容:
#deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/
bionic main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://es.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://es.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://es.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://es.archive.ubuntu.com/ubuntu/ bionic-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://es.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://es.archive.ubuntu.com/ubuntu/ bionic universe
deb http://es.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://es.archive.ubuntu.com/ubuntu/ bionic-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://es.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://es.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://es.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://es.archive.ubuntu.com/ubuntu/ bionic-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://es.archive.ubuntu.com/ubuntu/ bionic-backports main restricted
universe multiverse
# deb-src http://es.archive.ubuntu.com/ubuntu/ bionic-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 bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner
deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main
restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
答案1
我们先看一下错误信息中的关键部分:
Los siguientes paquetes tienen dependencias incumplidas:
libgail-3-0 : Depende: libgtk-3-0 (=3.22.30-1ubuntu4) pero 3.22.30-1ubuntu1 está instalado
libgtk-3-bin : Depende: libgtk-3-0 (>= 3.22.30-1ubuntu4) pero 3.22.30-1ubuntu1 está instalado
它说你正在尝试用旧版本升级较新的软件包。再读一遍,密切注意版本号之间的差异。
让我们使用一个方便的 apt 工具来查看这些包来自哪个存储库:
$ apt cache madison libgtk-3-bin
libgtk-3-bin | 3.22.30-1ubuntu1 | http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
libgtk-3-bin | 3.22.30-1ubuntu4 | http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
哦,看,两个包都列出了。一个在 bionic 中,另一个在 bionic-updates 中。
因此系统抱怨它需要来自 bionic-updates 的版本,但无法安装它。
是时候查看软件和更新控制面板(或 /etc/apt/sources.list)中的源了。确保 bionic-updates 的 repo 存在并已启用。
答案2
首先尝试这个命令:
apt --fix-broken install
进而:
sudo apt update