Score:0

Why I got the error: %pre(MariaDB-server-10.9.3-1.el7.centos.x86_64) scriptlet failed, exit status 1?

eh flag

I tried to install mariadb-server on my Centos 7 server by following commands:

def install_mariadb(distributor, release, host, maria_version, root_password):
    
    galera = 'galera-3' if maria_version == "10.3" else "galera-4" 
    
    if distributor == 'centos':
        # Step 1: create the repository
        commands = [
            "sudo yum install -y wget",
            'sudo wget -q https://downloads.mariadb.com/MariaDB/mariadb_repo_setup',
            "sudo chmod +x mariadb_repo_setup",
            f'sudo ./mariadb_repo_setup -s -- --mariadb-server-version={maria_version}',
            f'sudo yum install -y MariaDB-server MariaDB-client MariaDB-backup MariaDB-common MariaDB-shared {galera}'
        ]

Here is my terminal output:

sudo yum install -y wget
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centosmirror.netcup.net
 * epel: mirror.23m.com
 * extras: mirror.softaculous.com
 * updates: mirror.checkdomain.de
Package wget-1.14-18.el7_6.1.x86_64 already installed and latest version
Nothing to do

sudo wget -q https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
sudo chmod +x mariadb_repo_setup
sudo ./mariadb_repo_setup -s -- --mariadb-server-version=10.9
/etc/pki/rpm-gpg ~
~
Loaded plugins: fastestmirror
Cleaning repos: base epel extras mariadb-main mariadb-maxscale mariadb-tools
              : updates
Cleaning up list of fastest mirrors

sudo yum install -y MariaDB-server MariaDB-client MariaDB-backup MariaDB-common MariaDB-shared galera-4
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: centosmirror.netcup.net
 * epel: mirror.23m.com
 * extras: ftp.rz.uni-frankfurt.de
 * updates: mirror.checkdomain.de
Package MariaDB-client-10.9.3-1.el7.centos.x86_64 already installed and latest version
Package MariaDB-backup-10.9.3-1.el7.centos.x86_64 already installed and latest version
Package MariaDB-common-10.9.3-1.el7.centos.x86_64 already installed and latest version
Package MariaDB-shared-10.9.3-1.el7.centos.x86_64 already installed and latest version
Package galera-4-26.4.12-1.el7.centos.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-server.x86_64 0:10.7.6-1.el7.centos will be updated
---> Package MariaDB-server.x86_64 0:10.9.3-1.el7.centos will be an update
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package            Arch       Version                   Repository        Size
================================================================================
Updating:
 MariaDB-server     x86_64     10.9.3-1.el7.centos       mariadb-main      26 M

Transaction Summary
================================================================================
Upgrade  1 Package

Total download size: 26 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction

******************************************************************
A MySQL or MariaDB server package (MariaDB-server-10.7.6-1.el7.centos.x86_64) is installed.

Upgrading directly from MySQL 10.7 to MariaDB 10.9 may not
be safe in all cases.  A manual dump and restore using mysqldump is
recommended.  It is important to review the MariaDB manual's Upgrading
section for version-specific incompatibilities.

A manual upgrade is required.

- Ensure that you have a complete, working backup of your data and my.cnf
  files
- Shut down the MySQL server cleanly
- Remove the existing MySQL packages.  Usually this command will
  list the packages you should remove:
  rpm -qa | grep -i '^mysql-'

  You may choose to use 'rpm --nodeps -ev <package-name>' to remove
  the package which contains the mysqlclient shared library.  The
  library will be reinstalled by the MariaDB-shared package.
- Install the new MariaDB packages supplied by MariaDB Foundation
- Ensure that the MariaDB server is started
- Run the 'mysql_upgrade' program

This is a brief description of the upgrade process.  Important details
can be found in the MariaDB manual, in the Upgrading section.
******************************************************************
error: %pre(MariaDB-server-10.9.3-1.el7.centos.x86_64) scriptlet failed, exit status 1
  Verifying  : MariaDB-server-10.9.3-1.el7.centos.x86_64                    1/2
  Verifying  : MariaDB-server-10.7.6-1.el7.centos.x86_64                    2/2

Failed:
  MariaDB-server.x86_64 0:10.7.6-1.el7.centos
  MariaDB-server.x86_64 0:10.9.3-1.el7.centos

Complete!

Error in PREIN scriptlet in rpm package MariaDB-server-10.9.3-1.el7.centos.x86_64
MariaDB-server-10.7.6-1.el7.centos.x86_64 was supposed to be removed but is not!

Why I have the

error: %pre(MariaDB-server-10.9.3-1.el7.centos.x86_64) scriptlet failed, exit status 1

end also

Error in PREIN scriptlet in rpm package MariaDB-server-10.9.3-1.el7.centos.x86_64 MariaDB-server-10.7.6-1.el7.centos.x86_64 was supposed to be removed but is not

How can I fix that errors?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.