Wine: How to fix held broken packages?

13,413

it seems to me your issue is you are attempting to use Cosmic sources with Bionic : https://wiki.ubuntu.com/Releases

run :

sudo apt-add-repository --remove 'deb https://dl.winehq.org/wine-builds/ubuntu/ cosmic main'
sudo apt update
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
sudo apt update
sudo apt install --install-recommends winehq-stable

also as a long-time user of wine who has experience using it, the best possible wine experience comes from letting other programs configure & use it for you, E.G. Steam and Lutris. While both are meant to be used for running specifically gaming apps, I've used them successfully with non-gaming apps. You should probably take a look.

Share:
13,413

Related videos on Youtube

Ced
Author by

Ced

Junior full-stack developer, Specialised in Front-End

Updated on September 18, 2022

Comments

  • Ced
    Ced over 1 year

    I followed the WineHQ Wiki in order to install WINE, So I typed all the following lines:

    sudo dpkg --add-architecture i386 
    wget -nc https://dl.winehq.org/wine-builds/winehq.key
    sudo apt-key add winehq.key
    sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ cosmic main' 
    sudo apt update
    

    and then when typing:

    sudo apt install --install-recommends winehq-stable
    

    image packages

    In order to get the packages of the Stable branch. I had the following output:

    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 (= 4.0~trusty)
    E: Unable to correct problems, you have held broken packages.
    

    What does it mean please?

    edit: I already tried to run

    sudo apt-get update
    

    but it doesn't work.

    EDIT: Added Software sources:
    Software sources

  • user535733
    user535733 about 5 years
    Good catch! That is indeed a very frequent cause of this kind of "impossible situation"
  • Ced
    Ced about 5 years
    Curious, I still have the same error: E: Unable to correct problems, you have held broken packages.
  • tatsu
    tatsu about 5 years
    hmm, try sudo dpkg --configure -a then sudo apt install -f
  • tatsu
    tatsu about 5 years
    also follow that up with sudo apt autoremove, sudo apt autoclean (are you sure wine was the only source you added that was of the wrong distribution? check you software sources all of them should have "bionic", "stable" or "stretch" as the second to last word) if they don't, remove them.
  • Ced
    Ced about 5 years
    Thank for your answer, I tried sudo dpkg --configure -a then sudo apt install -f but this does not fix it. Do you know how can I check my software sources ?
  • tatsu
    tatsu about 5 years
    open up start menu, type "So" and you open "Software and Sources". switch to second tab.
  • Ced
    Ced about 5 years
    Thank you, I updated my post in order to give you all details related to the software sources.
  • tatsu
    tatsu about 5 years
    right-click on the "trusty" source and select delete, type your password, then tick "Canonical Partners", close Software & Sources, wait for source reload, open up a terminal, run sudo dpkg --configure -a && sudo apt install -f && sudo apt update && sudo apt autoremove -y && sudo apt autoclean && sudo apt full-upgrade -y && sudo apt install && wget -nc https://dl.winehq.org/wine-builds/winehq.key && sudo apt-key add winehq.key && sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' -y && sudo apt update && sudo apt install --install-recommends winehq-stable -y
  • tatsu
    tatsu about 5 years
    you didn't answer why you preferred to run and configure wine manually rather than have applications that do it for you. seeing how new you seem to sources and such you'd be much better off. I personally think even wine experts (I'm almost one) are better off. just use lutris
  • Ced
    Ced about 5 years
    sorry, I wanted wine because PlayOnLinux need it in order to install Microsoft Office 2013
  • Ced
    Ced about 5 years
    I succeeded to install wine by uninstalling old sources and using sudo apt install wine-stable winetricks
  • tatsu
    tatsu about 5 years
    well that's bizzare. Play on linux doesn't need you to install wine, it should be able to install it itself. Play doesn't use the system's wine anyways, it uses it's own that's in it's own files.
  • tatsu
    tatsu about 5 years
    @Ced could you make me as answer. the old (and too new) sources were indeed what was causing the issue. and people need to know that they can rely on this answer.
  • Ced
    Ced about 5 years
    PLayOnLinux raises an error if you start running it without having already installed wine. Of course, thanks for your help however WineHQ was not properly working with me so I used sudo apt install wine-stable winetricks instead
  • tatsu
    tatsu about 5 years
    okay. noted. I didn't recall this behavior. lutris does not care what you have installed it needs only itself and it downloads it's own versions of wine.
  • Ced
    Ced about 5 years
    @tatsu Ok I'm taking notes thanks, in conclusion do you recommend me to use Lutris instead of PlayOnLinux in order to install Microsoft Office?
  • tatsu
    tatsu about 5 years
    it'll be a bit less straightforward you'd have to use a wineprefix meant for a game and change it's configuration so that it points to the office executable you want once it's installed. basically it's the same thing as wine. I dunno why that haven't created a runner for MSoffice, but it's not that relevant. the interesting part of lutris is that it offers proton, which is a basically a better version of wine.
  • Max Svid
    Max Svid about 4 years
    +1 for that. I'm using Lutris to manage my music production workstation
  • David
    David over 2 years
    Your answer does not cover the question asked.
  • Zakaria Abdelaziz
    Zakaria Abdelaziz over 2 years
    why don't you answer then