I am writing a script for auto tuning Manjaro for myself and I ran into a problem:

If I need to install packages, I run this command:

sudo pacman -Syu --needed package list

As a result, if some of the packages are already installed, then nothing terrible, the installation will still be completed.

But I don’t understand how to write a similar command for deletion so that all packages from the list are deleted, even if already deleted or not yet installed packages are included in the list so that there are no errors like "such a package could not be found."

    0