0

Ubuntu 20.04

Long story short: on a new box mysql 8 was installed, then uninstalled and purged, then mysql 5.7 was installed with a fair bit of difficulty via alternative repositories. For reference, here is a link to the recipe I used to install 5.7: https://computingforgeeks.com/how-to-install-mysql-on-ubuntu-focal/

My question: How do I ensure that future upgrade activities will preserve mysql 5.7 and avoid mysql 8 being inadvertently upgraded on top of it?

Thank you for your time.

1
  • I would also like to point out that when I run Software Updater it reports: Not all updates can be installed.
    – Rich Johns
    Dec 29, 2020 at 16:09

2 Answers 2

1

Lock the package to particular version. I'm not sure how to do this using command line, as I usually use Synaptic to install or remove anything. In Synaptic, select the package in installed packages list and from menu select Package -> Lock version (I'm not sure about the exact English names of menu option, as I'm using a non-English language version of Ubuntu). Packages with locked version will never be updated.

3
  • I have read that one option is to edit /etc/apt/preferences.d/mysql or in my case create one and in it put lines like this: Package: mysql-server Pin: version 5.7.30-1ubuntu18.04 Pin-Priority: 1001
    – Rich Johns
    Dec 30, 2020 at 16:20
  • That is probably (?) equivalent to locking package version in Synaptic, as I described above.
    – raj
    Dec 30, 2020 at 16:27
  • 1
    I created a a file: /etc/apt/preferences.d/mysql and for the following packages I added 'Pin: version 5.7* Pin-Priority: 1001': libmysqlclient-dev, libmysqlclient20, libmysqld-dev, mysql-server, mysql-client, mysql-community-server, mysql-community-client, mysql-common, mysql-apt-config
    – Rich Johns
    Dec 30, 2020 at 19:47
1

Easiest and most resilient method would be to install mysql from source in /opt/ and use that version instead of the native one. You can copy the databases (without mysql running) in '/var/lib/mysql/ over to /opt/ and be totally independent of Ubuntu.

1
  • thanks Rinzwind, I agree this would be ideal, but, it was a bear getting 5.7 installed and working and I really don't want to mess with it . At this point I'd prefer to pin what I have.
    – Rich Johns
    Dec 30, 2020 at 14:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .