The clear answer is that you can use rpm -e <package name>
. This will not remove any package if there are dependencies.
My question would be is that possible with yum? If you do manually using yum, it is easy you can just type 'N' if dependencies detected. Is there elegant way in the script? Unfortunately, I found that repoquery
is not 100% accurate to list dependencies. Running yum remove <package> -n
and parsing the output looks also not nice solution even if this is possible. Please let me know your ideas, thanks