1

I want to remove QT5 and QT6 from my MSYS install. MSYS uses Pacman as its package manager.

Luckily, the packages I want to remove all follow a pattern in their name:

mingw-w64-x86_86-qt5-*

However, I cannot figure out how to remove them all. Trying with -R (remove) -s (search) finds all of them, but complains about the dependencies.

Once all of them are removed, there will be no dependency problem - nothing else relies on them but each other.

Is there some way to make this work?

1 Answers1

0

I guess that after a year and a half, you must have resorted to manually removing all dependencies. I had a similar problem with mingw-w64-x86_64-gcc-libs (apparently all packages in the world depend on it), so I have written a script to achieve this.

EDIT: The script is useless, just use

pacman -Rc mingw-w64-x86_86-qt5-*

OLD ANSWER

It's buggy enough to require invoking it a couple of times though before it actually finishes the job.

function remove_dependency() {
    delenda="$1"
    echo "Trying to remove dependency $delenda"
    pacman --noconfirm -R $delenda >/dev/null 2>/dev/null
    if [[ $? != 0 ]]
    then
        broken_deps="$(pacman --noconfirm -R $delenda 2>/dev/null | awk '{print $9}')"
        echo "ERROR: removing each of the following dependencies: $broken_deps"
    for dep in $broken_deps
    do
        remove_dependency $dep
    done
else
    echo "SUCCESS: removed $delenda"
fi

}

I store it as a script, so I add this line before EOF:

remove_dependency $1

And I invoke it like so:

$ ./removedep.sh mingw-w64-x86_64-gcc-libs