If I try to install multiple packages with one "apt" command, it is more likely to give dependency errors
If I try to excecute this AIO command:
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 teamviewerapt returns:
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.If I instead try to install only that package:
sudo apt -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install --install-recommends winehq-stableThe error does not occur.
Why?
How do I conveniently install all packages with a single command without getting wineHQ error?
UPDATE:
This is /etc/apt/sources.list:
# deb cdrom:[Ubuntu 20.10 _Groovy Gorilla_ - Release amd64 (20201022)] groovy main restricted
# See for how to upgrade to
# newer versions of the distribution.
deb groovy main restricted
deb-src groovy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb groovy-updates main restricted
deb-src 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 groovy universe
deb-src groovy universe
deb groovy-updates universe
deb-src 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 groovy multiverse
deb-src groovy multiverse
deb groovy-updates multiverse
deb-src 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 groovy-backports main restricted universe multiverse
deb-src 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 groovy partner
deb-src groovy partner
deb groovy-security main restricted
deb-src groovy-security main restricted
deb groovy-security universe
deb-src groovy-security universe
deb groovy-security multiverse
deb-src 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.This is /etc/apt/sources.list.d/angry-ip-scanner.list
deb [trusted=yes] wily main
deb-src [trusted=yes] wily mainThis is /etc/apt/sources.list.d/google-chrome.list
deb [signed-by=/usr/share/keyrings/google-archive-keyring.gpg] stable main
deb-src [signed-by=/usr/share/keyrings/google-archive-keyring.gpg] stable mainThis is /etc/apt/sources.list.d/skype-stable.list
deb [signed-by=/usr/share/keyrings/skypeforlinux-archive-keyring.gpg] stable main
deb-src [signed-by=/usr/share/keyrings/skypeforlinux-archive-keyring.gpg] stable mainThis is /etc/apt/sources.list.d/teamviewer.list
deb [signed-by=/usr/share/keyrings/teamviewer-archive-keyring.gpg] stable main
deb-src [signed-by=/usr/share/keyrings/teamviewer-archive-keyring.gpg] stable mainThis is /etc/apt/sources.list.d/winehq.list
deb [signed-by=/usr/share/keyrings/winehq-archive-keyring.gpg] groovy main
deb-src [signed-by=/usr/share/keyrings/winehq-archive-keyring.gpg] groovy main 1 3 Answers
You would solve it by using the command plainly without the extra options and having the correct sources for your distribution. You usually see that will not be installed because this package is not available when incorrectly mixed source line from two different distributions is used. Using most times a newer release to get new higher version of software installed on an older release it will never install on. We will need to see your /etc/apt/sources.list to be able to help you further, an apt-cache policy winehq-stable and the other would be nice to see along with the version of Ubuntu you run as the error says it should be 20.10 the Groovy Gorilla.
The problem was putting "ubuntu restricted-extras" together with "winehq" in the same "apt" command. If I separate them:
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 teamviewerthen everything works.
I've stopped using Apt-Get for multiple packages since it would always cause so much problems. I started using sudo dpkg -i like detailed below:
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 >That should be it.
Now, if what you're needing is a way to install one specific version of Wine in your system, and do it MANUALLY, without having to deal with Apt-Get repositories, I have the procedure detailed for you below, copied from another answer I posted.
Installing older/different versions of Wine than the latest ones from the repositories in Debian/Ubuntu system is a pain in the rear extremity.
Plan B: consider hopping over to Manjaro, if it's possible for you to do so. Why? Because the Manjaro version of the Wine package comes bundled IN A SINGLE PACKAGE, and you install it using A SINGLE COMMAND:
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)OK. If hopping over to Arch/Manjaro is NOT a possibility for you, these below are the steps for MANUALLY installing older versions of Wine on Debian/Ubuntu-based distros:
- Let's say you want to install Wine version 4.1 (one of the last versions of Wine before the Wineprefix size increased from 100 MB straight to 600 MB, without no additional benefits and no avoidance of the usual bugs from the last 10 years...)
Go to
and download all packages that have 4.1 in their name (they should have the same Date to them)
In the case of Wine 4.1 (the version that I've found to be the optimal one) these are the packages you need. You always will need FIVE packages in total.
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- Installation order. Here comes the tricky part, after you do it the 1st time it should be easier the next times. First, you install the biggest i386 package, always. Then, you install the small i386 package. Then, install the big amd64 package, and the small amd64 package. The last to be installed should be winehq (which only comes in amd64 form)
Below is a copy of my bash history with the order of commands I used to do this in shortest time.
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" >Notice how you need to run
sudo apt-get install -f every single time each package is installed. That will guarantee that the individual dependencies to each package are installed and configured, before you install the next package. (this is only needed the 1st time you do this... after that, you can put all these dependencies, store them in a Backup location, and install them all-at-once using sudo dpkg -i /path/*.deb )
Sometimes, and I don't understand why this happens, you won't be able to use Wine 64 bits, or you won't be able to use Wine 32 bits, one of the two. If that happens, simply re-install one of the big Wine packages again (depending if you need amd64 or i386)
sudo dpkg -i /path/wine-staging-amd64_4.1_buster_amd64.deb
It's very unfortunate that Wine has been distributed like this on Debian/Ubuntu system, it's an overcomplicated process with a lot of time wasted. The way Manjaro does it should become the official way Wine is distributed from now on.