我正在尝试从官方 ppa 安装 wine1.7,我的操作系统是 Ubuntu 14.04 64 位,但是当我使用命令apt-get
安装 wine 时,输出是:
The following packages have unmet dependencies:
wine1.7 : Depends: wine1.7-i386 (= 1:1.7.38-0ubuntu1)
E: Unable to correct problems, you have held broken packages.
我该如何解决这个问题?
附加信息:wine1.6 也无法安装。似乎我安装的一些软件包导致了这个问题,因为我之前成功安装了 wine。一个问题可能与此有关:当我使用时apt-get upgrade
,出现消息:
The following packages have been kept back:
linux-generic-lts-utopic linux-headers-generic-lts-utopic
linux-image-generic-lts-utopic
我添加了存储库
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
正如我在无法安装 wine 1.7 时有人建议的那样(当时 wine1.6 安装成功),希望这会有所帮助。
sudo dpkg --add-architecture i386
不起作用。
当我尝试使用软件中心安装 wine 时,它显示:
The following packages have unmet dependencies:
wine1.6: Depends: wine1.6-amd64 (= 1:1.6.2-0ubuntu4) but 1:1.6.2-0ubuntu4 is to be installed
Depends: wine1.6-i386 (= 1:1.6.2-0ubuntu4) but it is a virtual package.
我删除了上面提到的存储库并删除了保留的 3 个包,然后重新启动了计算机。仍然不起作用。
很奇怪,怎么能apt-get
说you have held broken packages.
包裹根本没有破损呢?
答案1
实际上,我在尝试使用 aptitude 安装时遇到了与您相同的错误。(即 sudo aptitude install wine1.7)我发现我缺少 libgphoto2-port10 依赖项,通过快速谷歌搜索就可以安装它。
答案2
在尝试了 14.04 上所有其他方法让 wine1.6 运行之后,这工作:
任何已安装的 wine 包都会引发问题:
sudo dpkg -l | grep wine
删除 /etc/apt/sources.list.d/ 中列出的所有 wine-PPA 源,例如
sudo rm /etc/apt/sources.list.d/ubuntu-wine-ppa-trusty.list
sudo rm /etc/apt/sources.list.d/wine-wine-builds-trusty.list
/etc/apt/sources.list
通过编辑将 [arch=amd64,i386] 添加到 deb-line 来支持多架构:
sudo vi /etc/apt/sources.list
这里:
# deb cdrom:[Ubuntu 14.04.3 LTS _Trusty Tahr_ - Beta amd64 (20150805)]/ trusty main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty-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 [arch=amd64,i386] http://us.archive.ubuntu.com/ubuntu/ trusty universe
根据此回答,大概该文件 /etc/dpkg/dpkg.cfg.d/multiarch 包含一个 foreign-architecture 键。因此我建议直接删除该文件:
sudo rm /etc/dpkg/dpkg.cfg.d/multiarch
再次添加 PPA 来检索 wine 并解决 dpkg 识别 i386:
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo dpkg --add-architecture i386
sudo apt-get update
安装 wine:
sudo aptitude --full-resolver -f install wine1.6
结果是:
...
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) libgphoto2-6:i386 [Not Installed]
2) libgphoto2-port10:i386 [Not Installed]
...
15) wine1.6 [Not Installed]
16) wine1.6-amd64 [Not Installed]
17) wine1.6-i386:i386 [Not Installed]
Leave the following dependencies unresolved:
...
这里r 15
将为我们提供其他解决方案,其中仍然包括安装 wine1.6(根据您的终端输出进行调整)
Accept this solution? [Y/n/q/?] r 15
结果是:
Keep the following packages at their current version:
1) libgphoto2-6:i386 [Not Installed]
2) libgphoto2-port10:i386 [Not Installed]
...
15) R wine1.6 [Not Installed]
16) wine1.6-amd64 [Not Installed]
17) wine1.6-i386:i386 [Not Installed]
Leave the following dependencies unresolved:
...
不要接受此解决方案,因为您想要降级选项。
Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:
Downgrade the following packages:
1) libudev1 [204-0ubuntu19 (now) -> 204-0ubuntu18 (saucy)]
...
接受此解决方案
Accept this solution? [Y/n/q/?] Y
The following packages will be DOWNGRADED:
libudev1
我的版本上需要降级的确切软件包与答案中列出的软件包不同,但性能完全相同。