You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 20.04安装winehq-stable时出现依赖不满足错误的解决求助

Ubuntu 20.04安装winehq-stable时出现依赖不满足错误的解决求助

我按照Wine官方教程在Ubuntu 20.04上安装Wine,执行了以下步骤:

  • 添加32位架构支持:
    sudo dpkg --add-architecture i386
    
  • 下载并添加WineHQ密钥:
    sudo wget -nc -O /usr/share/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
    
  • 添加对应Ubuntu 20.04(focal)的源:
    sudo wget -nc -P /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/focal/winehq-focal.sources
    
  • 更新软件源:
    sudo apt update
    

前面这些步骤都正常执行,但当我尝试安装Wine稳定版时:

sudo apt install --install-recommends winehq-stable

却反复遇到以下错误:

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:
winehq-stable : Depends: wine-stable (= 8.0.0.0~jammy-1)
E: Unable to correct problems, you have held broken packages.

我已经翻了好多论坛、试了各种方法都没解决,有没有大佬能帮我捋一捋?


给你几个亲测有效的排查修复步骤

我之前也碰到过类似的坑,试试下面这些方法:

  1. 先修复系统已有的损坏依赖
    先让系统自动处理下可能存在的依赖问题:

    sudo apt --fix-broken install
    

    这个命令会自动尝试补全缺失的依赖、清理损坏的安装包。

  2. 检查是否有被锁定的包
    错误提示里提到了"held broken packages",先看看哪些包被锁定了:

    dpkg --get-selections | grep hold
    

    如果发现有和Wine相关的锁定包,用下面的命令解锁:

    sudo apt-mark unhold [包名]
    

    把[包名]替换成实际查到的锁定包名称就行。

  3. 确认源和系统版本匹配
    你用的是Ubuntu 20.04(focal),但错误里显示依赖的是jammy(Ubuntu 22.04)版本的wine-stable,这大概率是源的问题!
    检查下你添加的源文件内容:

    cat /etc/apt/sources.list.d/winehq-focal.sources
    

    如果里面出现了jammy的字样,手动编辑替换成focal,然后重新更新源:

    sudo apt update
    
  4. 手动指定适配focal的版本安装
    先搜索下当前源里可用的wine-stable版本:

    apt-cache policy wine-stable
    

    然后选择适配focal的版本,比如像这样指定版本安装:

    sudo apt install --install-recommends wine-stable=[focal对应的版本号] winehq-stable=[focal对应的版本号]
    
  5. 改用Ubuntu官方仓库的Wine包
    如果上面的方法都不行,不如先删掉第三方的WineHQ源,改用官方仓库的包试试(版本可能不是最新,但兼容性更稳):

    sudo rm /etc/apt/sources.list.d/winehq-focal.sources
    sudo rm /usr/share/keyrings/winehq-archive.key
    sudo apt update
    sudo apt install wine-stable
    

备注:内容来源于stack exchange,提问作者Arthur De Backer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 09:34:31