AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1318676
Accepted
Mario Palumbo
Mario Palumbo
Asked: 2021-02-24 06:37:12 +0800 CST2021-02-24 06:37:12 +0800 CST 2021-02-24 06:37:12 +0800 CST

如果我尝试使用一个“apt”命令安装多个软件包,则更有可能出现依赖错误

  • 772

如果我尝试执行此 AIO 命令:

sudo apt -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --install-recommends build-essential checkinstall ubuntu-restricted-extras libglib2.0-dev libgtk2.0-dev rar zip unzip p7zip p7zip-full gparted hardinfo lprng gimp geany thonny thunderbird birdtray skypeforlinux putty screen net-tools winehq-stable expect ipscan google-chrome-stable teamviewer

适当的回报:

The following packages have unmet dependencies:
 winehq-stable : Depends: wine-stable (= 6.0.0~groovy-1)
E: Unable to correct problems, you have held broken packages.

如果我尝试仅安装该软件包:

sudo apt -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --install-recommends winehq-stable

错误不会发生。

为什么?

如何使用单个命令方便地安装所有软件包而不会出现 wineHQ 错误?

更新:

这是 /etc/apt/sources.list:

# deb cdrom:[Ubuntu 20.10 _Groovy Gorilla_ - Release amd64 (20201022)] groovy main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu groovy main restricted
deb-src http://archive.ubuntu.com/ubuntu groovy main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu groovy-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu groovy-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://archive.ubuntu.com/ubuntu groovy universe
deb-src http://archive.ubuntu.com/ubuntu groovy universe
deb http://archive.ubuntu.com/ubuntu groovy-updates universe
deb-src http://archive.ubuntu.com/ubuntu groovy-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://archive.ubuntu.com/ubuntu groovy multiverse
deb-src http://archive.ubuntu.com/ubuntu groovy multiverse
deb http://archive.ubuntu.com/ubuntu groovy-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu groovy-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://archive.ubuntu.com/ubuntu groovy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu groovy-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 groovy partner
deb-src http://archive.canonical.com/ubuntu groovy partner

deb http://security.ubuntu.com/ubuntu groovy-security main restricted
deb-src http://security.ubuntu.com/ubuntu groovy-security main restricted
deb http://security.ubuntu.com/ubuntu groovy-security universe
deb-src http://security.ubuntu.com/ubuntu groovy-security universe
deb http://security.ubuntu.com/ubuntu groovy-security multiverse
deb-src http://security.ubuntu.com/ubuntu groovy-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.

这是 /etc/apt/sources.list.d/angry-ip-scanner.list

deb [trusted=yes] http://ppa.launchpad.net/upubuntu-com/network/ubuntu wily main
deb-src [trusted=yes] http://ppa.launchpad.net/upubuntu-com/network/ubuntu wily main

这是 /etc/apt/sources.list.d/google-chrome.list

deb [signed-by=/usr/share/keyrings/google-archive-keyring.gpg] http://dl.google.com/linux/chrome/deb stable main
deb-src [signed-by=/usr/share/keyrings/google-archive-keyring.gpg] http://dl.google.com/linux/chrome/deb stable main

这是 /etc/apt/sources.list.d/skype-stable.list

deb [signed-by=/usr/share/keyrings/skypeforlinux-archive-keyring.gpg] https://repo.skype.com/deb stable main
deb-src [signed-by=/usr/share/keyrings/skypeforlinux-archive-keyring.gpg] https://repo.skype.com/deb stable main

这是 /etc/apt/sources.list.d/teamviewer.list

deb [signed-by=/usr/share/keyrings/teamviewer-archive-keyring.gpg] http://linux.teamviewer.com/deb stable main
deb-src [signed-by=/usr/share/keyrings/teamviewer-archive-keyring.gpg] http://linux.teamviewer.com/deb stable main

这是 /etc/apt/sources.list.d/winehq.list

deb [signed-by=/usr/share/keyrings/winehq-archive-keyring.gpg] https://dl.winehq.org/wine-builds/ubuntu/ groovy main
deb-src [signed-by=/usr/share/keyrings/winehq-archive-keyring.gpg] https://dl.winehq.org/wine-builds/ubuntu/ groovy main
apt
  • 3 3 个回答
  • 443 Views

3 个回答

  • Voted
  1. user1179897
    2021-02-24T08:03:18+08:002021-02-24T08:03:18+08:00

    您可以通过简单地使用该命令来解决它,而无需额外的选项并为您的发行版提供正确的来源。您通常会看到不会安装,因为当使用来自两个不同发行版的错误混合源代码行时,此包不可用。大多数时候使用较新的版本来获得安装在旧版本上的新的更高版本的软件,它永远不会安装在旧版本上。我们将需要看到您/etc/apt/sources.list能够进一步帮助您,apt-cache policy winehq-stable并且另一个会很高兴看到您运行的 Ubuntu 版本,因为错误说它应该是 20.10 Groovy Gorilla。

    • 1
  2. Best Answer
    Mario Palumbo
    2021-02-25T01:20:37+08:002021-02-25T01:20:37+08:00

    问题是将“ubuntu restricted-extras”与“winehq”放在同一个“apt”命令中。如果我将它们分开:

    sudo apt -y install --install-recommends ubuntu-restricted-extras
    sudo apt -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --install-recommends build-essential checkinstall libglib2.0-dev libgtk2.0-dev rar zip unzip p7zip p7zip-full gparted hardinfo lprng gimp geany thonny thunderbird birdtray skypeforlinux putty screen net-tools winehq-stable expect ipscan google-chrome-stable teamviewer
    

    然后一切正常。

    • 0
  3. Winampah
    2021-03-13T19:01:03+08:002021-03-13T19:01:03+08:00

    我已经停止对多个包使用 Apt-Get,因为它总是会导致很多问题。我开始使用 sudo dpkg -i 如下详述:

    sudo dpkg -i /path/to/packages/*.deb
    < all the packages were installed at once... >
    < now, the command below is to ensure that no dependency was left behind >
    sudo apt-get -f install
    < if needed, this will automatically download all dependencies for you >
    

    应该是这样的。

    现在,如果您需要的是一种在系统中安装一个特定版本的 Wine 的方法,并手动执行,而无需处理 Apt-Get 存储库,我在下面为您提供了详细的过程,从另一个答案复制我已经发布。

    在 Debian/Ubuntu 系统的存储库中安装较旧/不同版本的 Wine 是一件很痛苦的事。

    计划 B:如果可能的话,考虑跳到 Manjaro。为什么?因为 Wine 包的 Manjaro 版本捆绑在一个单独的包中,并且您使用一个命令安装它:

    sudo pacman -U /local_path/wine-staging-5.1-1-x86_64.pkg.tar.zst
    or, in the case you miss dependencies..
    sudo pacman -Sy /path/wine...
    (I think that's the command... I'm not in Manjaro right now,
    the Sy command will download the dependencies for you 
    WITHOUT performing a full system upgrade, only the packages you need...
    pacman -U is the equivalent of sudo dpkg -i , for manual install)
    

    好的。如果您无法跳到 Arch/Manjaro,以下是在基于 Debian/Ubuntu 的发行版上手动安装旧版本 Wine 的步骤:

    1. 假设您要安装 Wine 4.1 版(Wineprefix 大小从 100 MB 直接增加到 600 MB 之前的最后一个 Wine 版本之一,没有额外的好处,也没有避免过去 10 年的常见错误......)
      转到https://dl.winehq.org/wine-builds/
      并下载名称中包含 4.1 的所有软件包(它们的日期应该相同)

    对于 Wine 4.1(我发现是最佳版本),这些是您需要的软件包。您总是需要总共五个包。

    winehq-staging_4.1_buster_amd64.deb
    wine-staging_4.1_buster_amd64.deb
    wine-staging_4.1_buster_i386.deb
    wine-staging-amd64_4.1_buster_amd64.deb
    wine-staging-i386_4.1_buster_i386.deb
    
    1. 安装顺序。棘手的部分来了,在你第一次做之后,下一次应该会更容易。首先,始终安装最大的 i386 软件包。然后,您安装小型 i386 软件包。然后,安装大 amd64 包和小 amd64 包。最后安装的应该是 winehq (仅以 amd64 形式出现)

    下面是我的 bash 历史记录的副本,其中包含我在最短的时间内执行此操作的命令顺序。

    sudo dpkg --add-architecture i386
    sudo apt-get update
    sudo dpkg -i /path/wine-staging-i386_4.1_buster_i386.deb
    sudo apt-get install -f
    sudo dpkg -i /path/wine-staging_4.1_buster_i386.deb
    sudo apt-get install -f
    sudo dpkg -i /path/wine-staging-amd64_4.1_buster_amd64.deb
    sudo apt-get install -f
    sudo dpkg -i /path/wine-staging_4.1_buster_amd64.deb
    sudo apt-get install -f
    sudo dpkg -i /path/winehq-staging_4.1_buster_amd64.deb
    sudo apt-get install -f
    sudo apt-get update
    ...
    winecfg    <used to create the initial Wine prefix>
    <use these ones below to reassure that you have all libs installed correctly>
    ...
    WINEPREFIX=~/.wine32 WINEARCH=win32 winecfg  <to test if 32-bit is working OK>
    WINEPREFIX=~/.wine64 WINEARCH=win64 winecfg  <to test if 64-bit is working OK>
    <you should not see errors in the terminal of the type
    "but the wrong architecture is being used" >
    

    注意你需要如何运行

    sudo apt-get install -f  
    

    每次安装每个软件包时。这将保证在安装下一个包之前安装和配置每个包的各个依赖项。(这仅在您第一次执行此操作时需要...之后,您可以放置​​所有这些依赖项,将它们存储在备份位置,然后使用 sudo dpkg -i /path/*.deb 一次性安装它们)

    1. 有时,我不明白为什么会发生这种情况,您将无法使用 Wine 64 位,或者您将无法使用 Wine 32 位,两者之一。如果发生这种情况,只需再次重新安装一个大型 Wine 软件包(取决于您是否需要 amd64 或 i386)

      sudo dpkg -i /path/wine-staging-amd64_4.1_buster_amd64.deb

    非常不幸的是,Wine 已经在 Debian/Ubuntu 系统上像这样分发,这是一个过于复杂的过程,浪费了大量的时间。从现在开始,Manjaro 的做法应该成为 Wine 的官方分发方式。

    • 0

相关问题

  • 如何编写 shell 脚本来安装应用程序列表?

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve