4

I'm trying to install bugzilla3. I previously had mysql-server-5.1 installed, and it gave the following error:

Aborting downgrade from (at least) 5.1 to 5.0.
dpkg: error processing /var/cache/apt/archives/mysql-server-5.0_5.1.30really5.0.75-0ubuntu10.2_i386.deb (--unpack):
subprocess pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/mysql-server-5.0_5.1.30really5.0.75-0ubuntu10.2_i386.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

I went onto the ubuntu irc channel and asked for help where I was told to downgrade mysql to 5.0 and then install bugzilla.

So I went to do this. However when I

sudo apt-get remove mysql-server-5.1

the bugzilla installation configuration begins, and goes until it stops again complaining about the 5.1 -> 5.0 downgrade.

So I went and asked again on the irc and I was told to

sudo apt-get clean
sudo apt-get update

which I did.

It was still happening however so I removed the bugzilla3 package and tried to remove mysql then. And apparently it wasn't there. (I checked mysql-server, mysql-server-5.1 and mysql-server-5.0).

So I went to install bugzilla3 again, and it got as far as last time and complained about mysql-server-5.1 -> 5.0 downgrade. And now apt-get reported it was there, but it won't remove it as it starts the bugzilla install.

How do I fix this?

Macha
  • 249
  • 2
  • 9

3 Answers3

2

If you look in /var/lib/dpkg/info/mysql-server-5.0.preinst you'll see:

show_downgrade_warning=0
for i in `ls $DATADIR/debian-*.flag 2>/dev/null`; do
  found_version=`echo $i | sed 's/.*debian-\([0-9\.]\+\).flag/\1/'`
  if dpkg --compare-versions "$this_version" '<<' "$found_version"; then
    show_downgrade_warning=1
    break;
  fi
done

So if you delete /var/lib/mysql/debian-*.flag it'll let it go through.

See the mysql docs on how to downgrade mysql itself safely

brian-brazil
  • 3,904
  • 1
  • 20
  • 15
0

You could force a removal of the bugzilla package with dpkg --purge?

crb
  • 7,928
  • 37
  • 53
0

just do this:

sudo apt-get remove mysql-server-5.1

sudo apt-get clean

mv /var/lib/mysql /var/lib/mysqlbak

sudo apt-get update

sudo apt-get install mysql-server

mv /var/lib/mysql /var/lib/mysqlbak2

mv /var/lib/mysqlbak /var/lib/mysql

sudo /etc/init.d/mysql restart

I know it's neither clean nor perfect but it works at least for me.