#!/bin/bash OLD_MYSQL=(mysql MySQL mariadb) for item in ${OLD_MYSQL[@]} do findVar=$(rpm -qa | grep -w ${item} | awk '{print$1}') echo $findVar rpm -e --nodeps $findVar done cat >> /etc/yum.repos.d/MariaDB.repo </etc/my.cnf.d/server.conf <