7

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

Ced
  • 823
  • 4
  • 13
  • 32
  • could you edit your post to include the commands you typed before that, E.G. what source did you add? also why are you resorting to wine specifially and not a super-layer such as proton, lutris, ect? what is the windows app you want to run? likely it is easier to set it up with lutris/proton – tatsu Mar 18 '19 at 11:37
  • 1
    Of course, thank you for your feedback. I added all the commands I typed before that, about the source it is sudo apt install --install-recommends winehq-stable of the WineHQ Wiki. The windows app I want to run is the following https://www.playonlinux.com/en/app-2665-Microsoft_Office_2013.html So I planned to install Wine, then PlayOnLinux and than Microsoft Office 2013. – Ced Mar 18 '19 at 11:45
  • actually this : sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ cosmic main' is the source. cosmic is for 18.10 not for 18.04 as you can see : https://wiki.ubuntu.com/Releases – tatsu Mar 18 '19 at 11:47

2 Answers2

5

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.

tatsu
  • 3,107
  • 1
    Good catch! That is indeed a very frequent cause of this kind of "impossible situation" – user535733 Mar 18 '19 at 11:56
  • 6
    Curious, I still have the same error: E: Unable to correct problems, you have held broken packages. – Ced Mar 18 '19 at 15:52
  • hmm, try sudo dpkg --configure -a then sudo apt install -f – tatsu Mar 19 '19 at 07:04
  • 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. – tatsu Mar 19 '19 at 08:11
  • 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 ? – Ced Mar 19 '19 at 08:19
  • open up start menu, type "So" and you open "Software and Sources". switch to second tab. – tatsu Mar 19 '19 at 11:37
  • Thank you, I updated my post in order to give you all details related to the software sources. – Ced Mar 20 '19 at 11:47
  • 1
    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 Mar 20 '19 at 13:57
  • 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 – tatsu Mar 20 '19 at 14:00
  • sorry, I wanted wine because PlayOnLinux need it in order to install Microsoft Office 2013 – Ced Mar 20 '19 at 14:09
  • I succeeded to install wine by uninstalling old sources and using sudo apt install wine-stable winetricks – Ced Mar 20 '19 at 14:11
  • 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 Mar 20 '19 at 14:18
  • @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. – tatsu Mar 21 '19 at 14:18
  • 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 – Ced Mar 21 '19 at 15:42
  • 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. – tatsu Mar 21 '19 at 16:10
  • @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? – Ced Mar 22 '19 at 21:20
  • 1
    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. – tatsu Mar 22 '19 at 23:53
  • +1 for that. I'm using Lutris to manage my music production workstation – Max Svidlo Mar 18 '20 at 07:02
-1

sudo apt-add-repository 'deb http://archive.ubuntu.com/ubuntu/ focal-updates main universe restricted multiverse'

sudo apt-add-repository 'deb http://security.ubuntu.com/ubuntu focal-security main universe restricted multiverse'

sudo apt update

sudo apt full-upgrade

i was missing some respositories and this fixed it for me