How to fix Conflicts: package-name but version is to be installed in APT

APTINTERMEDIATEMEDIUMUpdated Dec 29, 2025ยท 216 views

The "Conflicts: package-name but version is to be installed" error occurs when apt detects conflicting package dependencies. This guide covers identifying the conflict, resolving dependency mismatches, and fixing broken package states to successfully complete your installation or upgrade.

Quick fix

Fixes Conflicts: package-name but version is to be installed

sudo apt update
sudo apt check
  1. Update your package cache and check for errors
  2. Fix broken dependencies with apt install -f
  3. Configure unpacked packages if needed
  4. Use Aptitude for advanced conflict resolution
apt โ€” error
sudo apt update
sudo apt check
Conflicts: package-name but version is to be installed

What this error means

When you run apt install or apt upgrade, the package manager checks for conflicts between packages and their dependencies. This error indicates that a package being installed or upgraded conflicts with another package already installed on your system, or with the specific version that apt is trying to install. The conflict is typically caused by incompatible versions of packages that both depend on conflicting libraries or functionality. APT's dependency resolver identifies this conflict and prevents installation to avoid breaking your system.

Typical symptoms

  • apt install or apt upgrade command fails immediately
  • Error message displays 'Conflicts: package-name but X.X.X is to be installed'
  • System shows unmet dependencies or broken packages
  • Synaptic Package Manager or apt shows the system is in a broken state
  • Multiple packages fail to install or upgrade simultaneously

Common causes

  1. Two packages installed that have conflicting requirements or incompatible versions
  2. Third-party PPA repositories introducing incompatible package versions
  3. Partially completed upgrades leaving the system in an inconsistent state
  4. Manually holding or pinning packages to specific versions that conflict with others
  5. Multiple repository sources providing different versions of the same package

How to fix "Conflicts: package-name but version is to be installed"

1Update your package cache and check for errors

Start by refreshing your package lists and checking for broken dependencies:

bash
sudo apt update
sudo apt check

The 'apt check' command will display detailed information about conflicts and unmet dependencies. Note which packages are involved in the conflict.

2Fix broken dependencies with apt install -f

APT can often resolve conflicts automatically by fixing broken dependencies:

bash
sudo apt install -f

This attempts to fix any broken package dependencies. Review the output carefully to see which packages will be removed or modified. Type 'Y' only if the changes look correct.

3Configure unpacked packages if needed

If the previous step didn't work, configure any packages that are unpacked but not fully configured:

bash
sudo dpkg --configure -a
sudo apt install -f

This completes any interrupted package installations before attempting to fix dependencies again.

4Use Aptitude for advanced conflict resolution

Aptitude is more intelligent at resolving package conflicts than apt-get. It can suggest multiple solutions and let you choose:

bash
sudo apt-get install aptitude
sudo aptitude install package-name

Aptitude will present various scenarios to resolve the conflict, such as:
- Removing one of the conflicting packages
- Installing a different version
- Upgrading or downgrading related packages

Choose the option that best suits your needs. Option 1 is usually the safest starting point.

5Investigate and remove third-party PPAs causing conflicts

Conflicts often arise from third-party PPA repositories. List your sources and identify suspicious ones:

bash
sudo add-apt-repository --list

If you find a PPA that's causing the conflict, remove it using:

bash
sudo add-apt-repository --remove ppa:username/ppa-name
sudo apt update
sudo apt install -f

Alternatively, use ppa-purge to remove a PPA and downgrade its packages to official versions:

bash
sudo apt-get install ppa-purge
sudo ppa-purge ppa:username/ppa-name
6Clean and reset the package manager state

If none of the above works, perform a complete package manager reset:

bash
sudo apt clean
sudo apt autoclean
sudo apt update
sudo dpkg --configure -a
sudo apt install -f
sudo apt dist-upgrade
sudo apt autoremove --purge

These commands in sequence will:
- Remove cached package files
- Update package lists
- Configure pending packages
- Fix broken dependencies
- Perform a full system upgrade
- Remove unnecessary packages

This comprehensive approach resolves most conflicts, but may remove or upgrade some packages.

7Check for held packages preventing resolution

Sometimes packages are manually held at a specific version, preventing conflict resolution:

bash
apt-mark showhold

If you see held packages listed, check if they're involved in the conflict. You can unhold them temporarily:

bash
sudo apt-mark unhold package-name
sudo apt install -f

Re-hold the package afterward if you want to keep it at a specific version:

bash
sudo apt-mark hold package-name

Advanced notes

For users managing multiple PPAs or non-standard repositories: conflicts become more common when mixing packages from different sources. Consider using 'apt-cache policy package-name' to see which repositories provide each package version. This helps identify which PPA is causing the conflict.

On systems with Snap packages: mixing Snap and traditional apt packages occasionally causes conflicts. Use 'apt-cache policy package-name' to confirm which package manager owns a particular package.

For automated systems and CI/CD pipelines: always pin critical packages to specific versions in your infrastructure code rather than relying on automatic upgrades, which can introduce conflicts. Use 'apt-mark hold package-name' in deployment scripts.

Frequently asked questions

What does "Conflicts: package-name but version is to be installed" mean?
When you run apt install or apt upgrade, the package manager checks for conflicts between packages and their dependencies. This error indicates that a package being installed or upgraded conflicts with another package already installed on your system, or with the specific version that apt is trying to install. The conflict is typically caused by incompatible versions of packages that both depend on conflicting libraries or functionality.
How do I fix "Conflicts: package-name but version is to be installed"?
The "Conflicts: package-name but version is to be installed" error occurs when apt detects conflicting package dependencies. This guide covers identifying the conflict, resolving dependency mismatches, and fixing broken package states to successfully complete your installation or upgrade.
What causes "Conflicts: package-name but version is to be installed"?
Two packages installed that have conflicting requirements or incompatible versions Third-party PPA repositories introducing incompatible package versions Partially completed upgrades leaving the system in an inconsistent state
Is the "Conflicts: package-name but version is to be installed" error serious?
It is a medium-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading