Conflicting packages

When you are a package hunter like me, have 2500 packages installed , you run into the following problem.
You install one interesting package but it takes down and uninstall 500 other packages.
When you do it manual you see can intervene.
But in my case i do it automaticly.
Have not found a way to solve this.
Many packages are conflicting which is normal . You cant have mariadb and mysql installed. Obvious.
 
My only solution i have is doing my automatic install and watching with my eye over it when it starts deinstalling and remove the conflicting package.
 
If one is worried about installing a package that may conflict and remove packages you don't want removed, run pkg install -n and actually look at the output for "deleted packages"
One could probably script that, grep output and make it easier for you to "not do something".
Or perhaps something with the pkg-rquery command and grepping against installed packages to see if desired packages are getting removed.
 
I think about writing a very small python program (popen) doing first the "pkg install dry run" , checking output for deinstall , and if there is no deinstall "pkg install force". I'm not good at shell scripting.
 
A few minutes later :) ,

Code:
import subprocess

def do_dry(my_string:str)-> str:
    print(f"Processing: {my_string}")
    command = ["pkg", "install","-n",my_string]
    process = subprocess.Popen(command,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE,text=True)
    stdout, stderr = process.communicate(input="optional input string")
    print(f"Output: {stdout}")
    print(f"Errors: {stderr}")
    print(f"Return code: {process.returncode}")
    return stdout

def do_force(my_string:str)-> str:
    print(f"Processing: {my_string}")
    command = ["pkg", "install","-f","-y",my_string]
    process = subprocess.Popen(command,stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE,text=True)
    stdout, stderr = process.communicate(input="optional input string")
    print(f"Output: {stdout}")
    print(f"Errors: {stderr}")
    print(f"Return code: {process.returncode}")
    return stdout

with open('example.txt', 'r') as file:
    for line in file:
        todo=line.strip()
        print(todo)
        stdout=do_dry(todo)
        if "REMOVED" in stdout:
            print("DO NOT INSTALL")
        else:
            print("DO INSTALL")
            do_force(todo)
 
I don't recall the exact format of the output, not sure if each removed package has each line with package name and removed or if there was a section "packages to be removed" then a list. If it's a section, you need to make sure you process it correctly.
 
my python program has the grep,
if "REMOVED" in stdout:
So it's checks for the word in capital removed.

If i understand you corrently , this might fail , if the word REMOVED is not shown. But then this would mean an error in the "pkg" program.

I think about "installing files in the same location". Maybe i must capture that.
 
If you are saying all you care about is "If I install new package A are any already installed packages going to be removed" then you are fine.
I was saying "If you actually cared about what packages may get removed, then I think the output winds up showing sections"
"The following new packages will be INSTALLED" followed by a list
"The following packages will be REINSTALLED" followed by a list
"The following packages will be REMOVED" followed by a list

If you care about what may be removed you need to figure out how to process that. If you don't care, then just looking for the word removed is fine.
 
Aha , from google AI,

Yes, several core KDE packages have specific requirements or dependencies for
PostgreSQL and MySQL/MariaDB versions, primarily for managing large-scale metadata and personal information.


1. Akonadi (KDE PIM)

Akonadi is the storage service for KDE's Personal Information Management (PIM) suite (KMail, KOrganizer, Kontact). It is the primary KDE package with strict database requirements.

  • Default Backend: While SQLite is now recommended for most users due to its lower resource footprint, MySQL/MariaDB remains a standard default for many distributions.
  • Version Sensitivity: Major PostgreSQL upgrades can break Akonadi if the database cluster is not migrated. Some distributions (like Arch Linux) include automatic upgrade scripts to handle major version transitions for the PostgreSQL cluster located in ~/.local/share/akonadi/db_data/.
  • MySQL Requirements: Akonadi typically requires the InnoDB engine for transaction support, which is standard in modern MySQL and MariaDB versions.

2. Amarok

As of 2026, the music player Amarok continues to use relational databases for its collection management.

  • Backend Support: Amarok 3.3 (released July 2025) exclusively supports Qt6 and KDE Frameworks 6, which has updated its database schema for the first time since 2012.
  • External Databases: While it uses an embedded database by default, it can be configured to use external MySQL servers (default port 3306) for large collections.

3. DigiKam

The photo management software DigiKam requires a database to store image metadata and face recognition data.

  • Versioning: For very large collections (100,000+ items), DigiKam recommends MySQL or MariaDB.
  • Migration: It often requires specific database versions to maintain performance, and upgrading the software may trigger mandatory database schema updates.
 
Back
Top