所以我正在尝试编译 Aseprite,但我无法在此过程中安装我需要的包:libx11-dev。这是“sudo apt install libx11-dev”的输出
sudo apt install libx11-dev
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:
libx11-dev : Depends: libx11-6 (= 2:1.6.4-3ubuntu0.1) but 2:1.6.4-3ubuntu0.2 is to be installed
Depends: libxcb1-dev but it is not going to be installed
Recommends: libx11-doc but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
有两个未满足的依赖项。接下来我尝试安装第一个依赖项 libx11-6
sudo apt install libx11-6
Reading package lists... Done
Building dependency tree
Reading state information... Done
libx11-6 is already the newest version (2:1.6.4-3ubuntu0.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
可以看到已经安装好了,也是最新版本,2:1.6.4-3ubuntu0.2。正如您在第一条消息中看到的,这似乎是必需的版本。第二个“未满足”的依赖项也会出现类似的问题。
看来问题是我拿着破损的包裹。我已经尝试了很多方法来解决这个问题,但据我所知,我没有拿着任何破损的包裹。当我尝试:
dpkg --get-selections | grep hold
没有输出。同样,“sudo apt install -f”也不能解决任何问题。
这里有更多可能有帮助的输出
cat /etc/apt/sources.list
# deb cdrom:[Ubuntu 18.04.3 LTS _Bionic Beaver_ - Release amd64 (20190805)]/ bionic main restricted
deb-src http://archive.ubuntu.com/ubuntu bionic main restricted #Added by software-properties
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://fi.archive.ubuntu.com/ubuntu/ bionic main restricted
deb-src http://fi.archive.ubuntu.com/ubuntu/ bionic universe main restricted multiverse
## Major bug fix updates produced after the final release of the
## distribution.
# deb-src http://fi.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://fi.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://fi.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://fi.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://fi.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://fi.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://fi.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-src http://fi.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 universe main restricted multiverse
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
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
和
cat /etc/apt/sources.list.d/*
deb http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic main
deb-src http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic main
deb http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic main
deb-src http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic main
deb http://ppa.launchpad.net/jtaylor/keepass/ubuntu bionic main
deb-src http://ppa.launchpad.net/jtaylor/keepass/ubuntu bionic main
deb http://ppa.launchpad.net/jtaylor/keepass/ubuntu bionic main
deb-src http://ppa.launchpad.net/jtaylor/keepass/ubuntu bionic main
deb http://ppa.launchpad.net/libretro/stable/ubuntu bionic main
deb-src http://ppa.launchpad.net/libretro/stable/ubuntu bionic main
deb http://ppa.launchpad.net/libretro/stable/ubuntu bionic main
deb-src http://ppa.launchpad.net/libretro/stable/ubuntu bionic main
deb http://ppa.launchpad.net/pedrocastro/ppa/ubuntu bionic main
deb-src http://ppa.launchpad.net/pedrocastro/ppa/ubuntu bionic main
deb http://ppa.launchpad.net/pedrocastro/ppa/ubuntu bionic main
deb-src http://ppa.launchpad.net/pedrocastro/ppa/ubuntu bionic main
所以我通过安装和使用 aptitude 来安装而不是 apt (sudo aptitude install [packagename]) 解决了这个问题。这将尝试更彻底地解决问题,然后为您提供解决方案。我拒绝了第一个解决方案,下一个建议是降级依赖项。这修复了所有依赖项,并且包能够安装。
我仍然不明白为什么我的系统会出现这个问题。它也出现在安装 Nvidia 驱动程序时。我不知道这是否是我的存储库或 ppa 的问题,或者是 sources.list 或类似的问题。