[MDEV-5986] MariaDB upgrade on CentOS 6 fails due to sed error Created: 2014-03-31  Updated: 2014-04-18  Resolved: 2014-04-18

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.36, 10.0.10
Fix Version/s: 5.5.37, 10.0.11

Type: Bug Priority: Blocker
Reporter: Heinz Wiesinger Assignee: Sergei Golubchik
Resolution: Fixed Votes: 1
Labels: packaging

Attachments: File upgrade.log    
Issue Links:
Duplicate
is duplicated by MDEV-6010 MariaDB update from RPM/YUM repo failed Closed
Relates

 Description   

When updating MariaDB-server from 5.5.36 to 10.0.10 on CentOS, an error happens when trying to check information about the already installed MariaDB-server package.

The main issue seems to revolve around an invalid sed syntax:

Error in PREIN scriptlet in rpm package MariaDB-server-10.0.10-1.el6.x86_64
sed: invalid option – '1'

Full error message is attached as log file.



 Comments   
Comment by Elena Stepanova [ 2014-03-31 ]

The problem affects minor upgrades too, so it must be fixed by 5.5.37 release.

The line in the pre-in script is
installed=`echo "$installed"|sed -n -1p`

I'm not sure whether -1p is a non-standard sed option or a typo, but since it doesn't work with standard sed on the target systems, it can't be used.

It was introduced in 5.5 tree by the following revision:

revno: 4118
revision-id: sergii@pisem.net-20140324190137-t0554znbq5ed1w10
parent: sergii@pisem.net-20140319090334-mpgf90l05547ji8y
committer: Sergei Golubchik <sergii@pisem.net>
branch nick: 5.5
timestamp: Mon 2014-03-24 20:01:37 +0100
message:
  MDEV-5831 Upgrade from MariaDB 5.5.36 via yum fails
 
  Allow "rpm -q --whatprovides mysql-server" to return more than one row.
  (all rows should be identical though)

Comment by Tom Atkinson [ 2014-04-01 ]

Suggested fix:

installed=`echo "$installed"|uniq`

or

installed=`echo "$installed"|head -n1`

Comment by Chris Hills (Inactive) [ 2014-04-02 ]

I would suggest simply:-

installed =`echo "$installed"|sed -n p1`

In the mean time you can upgrade like this:-

sudo yum remove MariaDB-server && sudo yum install MariaDB-server

Comment by Hansen Ler [ 2014-04-04 ]

Thanks Christ for the workaround. Just remember after running this script

sudo yum remove MariaDB-server && sudo yum install MariaDB-server

Remember to start your SQL server

sudo service mysql start

Comment by Elena Stepanova [ 2014-04-04 ]

...and don't forget to run mysql_upgrade.
In other words, do what exactly the error message (after the sed error) says, it suggests to perform manual upgrade via remove/install.

Generated at Thu Feb 08 07:08:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.