Gemini answer:
The error
winehq-stable : Depends: wine-stable (= ...) combined with
E: Unable to correct problems, you have held broken packages occurs when APT cannot resolve 32-bit (
i386) dependencies, has conflicting repository keys/sources, or encounters held/stale packages.
Run the following steps in your terminal to fix the issue:
Step 1: Clear Conflicting Wine Repositories & Keys
Remove any existing or duplicate Wine source lists and keys to ensure a clean slate:
sudo rm -f /etc/apt/sources.list.d/winehq*.list
sudo rm -f /etc/apt/sources.list.d/winehq*.sources
sudo rm -f /etc/apt/keyrings/winehq*
sudo rm -f /usr/share/keyrings/winehq*
Step 2: Unhold Any Locked Packages & Purge Stale Installations
Ensure no packages are stuck on hold or partially installed:
# Check and release any held APT packages
sudo apt-mark unhold winehq-stable wine-stable wine-stable-i386
# Clean out any partial/broken Wine installs
sudo apt purge "wine*" "wine*:i386"
sudo apt autoremove --purge
Step 3: Re-enable 32-bit Architecture & Re-add Repository
Wine relies heavily on 32-bit libraries (i386). Re-add the architecture and download the official signing key:
# Enable 32-bit architecture
sudo dpkg --add-architecture i386
# Add Keyring
sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
# Add Official Repository (replace 'noble' with your Ubuntu codename if different, e.g., 'jammy')
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources
# Update package cache
sudo apt update
Step 4: Resolve Unmet Dependencies During Installation
If standard apt install still throws broken package errors, use
aptitude, which automatically searches for dependency resolution paths:
- Install aptitude:
sudo apt install aptitude
- Run the Wine installation via aptitude:
sudo aptitude install winehq-stable
- Important:When aptitude presents options:
- Type n (No) to the first proposal if it suggests "keep packages at their current version / do nothing".
- Type y (Yes) to the second proposal, which usually involves downgrading or upgrading conflicting underlying 32-bit libraries (like libc6:i386 or libavahi) to match the expected versions.