Straight-forward. How do I block upgrading MySQL Server when upgrading Ubuntu from 15.10 to 16.04.3.

Before starting, I held onto various MySQL-5.6 packages with apt-mark hold <pack>. Then, I followed the upgrade instructions from the official notes on a clone of the target server. I can recreate the initial conditions.

However, the upgrade procedure attempted to install mysql-5.7. Looking with dpkg -l | grep mysql I now have

  • rc mysql-server-5.6 -> Desired:Remove, Status:Conf-files
  • iU mysql-server -> Desired:Install, Status:Unpacked
  • iF mysql-server-5.7 -> Desired:Install, Status:halF-conf

and other mysql-*-core-5.7 packages installed (ii).

Instructions I followed

To upgrade on a server system:

  • Install the update-manager-core package if it is not already installed.
  • Make sure the /etc/update-manager/release-upgrades is set to normal if you are using 15.10, lts if you are using 14.04 LTS.
  • Launch the upgrade tool with the command sudo do-release-upgrade.
  • Follow the on-screen instructions.
  • 3
    Why do you not want to update MySQL? There's a number of vulnerabilities that you probably want to get rid of. You can update and keep all your data. – vidarlo Feb 19 '18 at 18:22
  • There are certain features regarding select queries that exist on 5.6 that did not make it to 5.7 even through compatibility options. Until I can find workarounds, I have to keep 5.6. However, I still have to upgrade the server – hanzo2001 Feb 19 '18 at 21:45

It seems something went wrong on the first couple of simulations. I changed something in my script and it is now holding perfectly.

So for anyone who were to cross this question, apt-mark hold <package> does work as expected

| improve this answer | |
  • Hey, i m having issue with update. .. It seems when update comes mysql turns off and never turns back on (unless i do it) :( i tried apt-mark hold mysql-server but it still turns off. .. Did you put on hold any other mysql packages? – Ingus Feb 7 at 8:34
  • 1
    It is probable that there is an update routine being executed that causes a service shutdown. I can't help you except by reminding you to check your syslog when it happens (check your mysql/error.log to confirm that it is a normal shutdown and not a crash). Logs in my system are located in the standard directory /var/log – hanzo2001 Feb 7 at 13:34
  • Thanks for reply! I already checked my logs it seems like it just shutdown without crash. .. Today i added apt-mark hold mysql-server-5.7 so maybe that one will do the trick – Ingus Feb 7 at 13:39
  • But was the shutdown registered in your syslog? If so, you may have an automated system routine that does not care wether your packages were hold or not. Be careful out there – hanzo2001 Feb 7 at 14:37
  • 1
    Yep syslog told Feb 7 06:35:45 portalz systemd[1]: Starting Daily apt upgrade and clean activities... Feb 7 06:35:57 portalz systemd[1]: Reloading. Feb 7 06:35:57 portalz systemd[1]: Stopping MySQL Community Server... Feb 7 06:35:59 portalz systemd[1]: Stopped MySQL Community Server. – Ingus Feb 7 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.